/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('airticketopen', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model DataSolutionListSegmentBaggageMappingListPassengerBaggageAllowanceMappingValue = {
  baggageAmount?: int32(name='baggage_amount', description='checked baggage quantity', example='22'),
  baggageWeight?: int32(name='baggage_weight', description='checked baggage weight', example='2'),
  baggageWeightUnit?: string(name='baggage_weight_unit', description='checked baggage weight unit', example='kg'),
  isAllWeight?: boolean(name='is_all_weight', description='Whether the weight is for all baggages', example='true'),
  carryOnAmount?: int32(name='carry_on_amount', description='carry-on baggage quantity', example='1'),
  carryOnWeight?: int32(name='carry_on_weight', description='carry-on baggage weight', example='2'),
  carryOnWeightUnit?: string(name='carry_on_weight_unit', description='carry-on baggage weight unit', example='kg'),
  isAllCarryOnWeight?: boolean(name='is_all_carry_on_weight', description='Whether the weight is for all baggages', example='true'),
}

model DataSolutionListSegmentRefundChangeRuleMappingListRefundChangeRuleMapValue = {
  refundRuleAllUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 0 - fully-unused ticket; 1 - partially used ticket', example='0'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable refund rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable refund rule end time, time unit (day/hour)', example='12'),
      canRefund?: boolean(name='can_refund', description='whether refundable X-Y hour(day) before departure', example='true'),
      refundFee?: double(name='refund_fee', description='refund fee X-Y hour(day) before departure', example='20'),
      canReturnAllTax?: boolean(name='can_return_all_tax', description='whether tax is fully refundable X-Y hour(day) before departure', example='true'),
      returnPartTaxFee?: double(name='return_part_tax_fee', description='tax amount refundable X-Y hour(day) before departure', example='20'),
    }
  ](name='refund_rule_all_unused_list', description='refund rule for fully-unused tickets'),
  refundRulePartUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 0 - fully-unused ticket; 1 - partially used ticket', example='1'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable refund rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable refund rule end time, time unit (day/hour)', example='12'),
      canRefund?: boolean(name='can_refund', description='whether refundable X-Y hour(day) before departure', example='true'),
      refundFee?: double(name='refund_fee', description='refund fee X-Y hour(day) before departure', example='20'),
      canReturnAllTax?: boolean(name='can_return_all_tax', description='whether tax is fully refundable X-Y hour(day) before departure', example='30'),
      returnPartTaxFee?: double(name='return_part_tax_fee', description='tax amount refundable X-Y hour(day) before departure', example='20'),
    }
  ](name='refund_rule_part_unused_list', description='refund rule for partially-used tickets'),
  changeRuleInUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 2 - outbound segment unused; 3 - inbound segment unused', example='2'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable change rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable change rule end time, time unit (day/hour)', example='12'),
      canChange?: boolean(name='can_change', description='whether changeable X-Y hour(day) before departure', example='true'),
      changeFee?: double(name='change_fee', description='change fee X-Y hour(day) before departure', example='20'),
    }
  ](name='change_rule_in_unused_list', description='change rule for inbound segment unused tickets'),
  changeRuleOutUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 2 - outbound segment unused; 3 - inbound segment unused', example='2'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable change rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable change rule end time, time unit (day/hour)', example='12'),
      canChange?: boolean(name='can_change', description='whether changeable X-Y hour(day) before departure', example='true'),
      changeFee?: double(name='change_fee', description='change fee X-Y hour(day) before departure', example='10'),
    }
  ](name='change_rule_out_unused_list', description='change rule for outbound segment unused tickets'),
}

model DataBaggageAllowanceMapValue = {
  baggageAmount?: int32(name='baggage_amount', description='checked baggage quantity', example='1'),
  baggageWeight?: int32(name='baggage_weight', description='checked baggage weight', example='10'),
  baggageWeightUnit?: string(name='baggage_weight_unit', description='checked baggage weight unit', example='KG'),
  isAllWeight?: boolean(name='is_all_weight', description='Whether the weight is for all baggages', example='true'),
  carryOnAmount?: int32(name='carry_on_amount', description='carry-on baggage quantity', example='1'),
  carryOnWeight?: int32(name='carry_on_weight', description='carry-on baggage weight', example='5'),
  carryOnWeightUnit?: string(name='carry_on_weight_unit', description='carry-on baggage weight unit', example='KG'),
  isAllCarryOnWeight?: boolean(name='is_all_carry_on_weight', description='Whether the weight is for all baggages', example='true'),
}

model DataRefundChangeRuleMapValue = {
  refundRuleAllUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 0 - fully-unused ticket; 1 - partially used ticket', example='0'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable refund rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable refund rule end time, time unit (day/hour)', example='12'),
      canRefund?: boolean(name='can_refund', description='whether refundable X-Y hour(day) before departure', example='true'),
      refundFee?: double(name='refund_fee', description='refund fee X-Y hour(day) before departure', example='200'),
      canReturnAllTax?: boolean(name='can_return_all_tax', description='whether tax is fully refundable X-Y hour(day) before departure', example='true'),
      returnPartTaxFee?: double(name='return_part_tax_fee', description='tax amount refundable X-Y hour(day) before departure', example='100'),
    }
  ](name='refund_rule_all_unused_list', description='refund rule for fully-unused tickets'),
  refundRulePartUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 0 - fully-unused ticket; 1 - partially used ticket', example='0'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable refund rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable refund rule end time, time unit (day/hour)', example='12'),
      canRefund?: boolean(name='can_refund', description='whether refundable X-Y hour(day) before departure', example='true'),
      refundFee?: double(name='refund_fee', description='refund fee X-Y hour(day) before departure', example='200'),
      canReturnAllTax?: boolean(name='can_return_all_tax', description='whether tax is fully refundable X-Y hour(day) before departure', example='true'),
      returnPartTaxFee?: double(name='return_part_tax_fee', description='tax amount refundable X-Y hour(day) before departure', example='100'),
    }
  ](name='refund_rule_part_unused_list', description='refund rule for partially-used tickets'),
  changeRuleInUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 2 - outbound segment unused; 3 - inbound segment unused', example='2'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable change rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable change rule end time, time unit (day/hour)', example='12'),
      canChange?: boolean(name='can_change', description='whether changeable X-Y hour(day) before departure', example='true'),
      changeFee?: double(name='change_fee', description='change fee X-Y hour(day) before departure', example='100'),
    }
  ](name='change_rule_in_unused_list', description='change rule for inbound segment unused tickets'),
  changeRuleOutUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 2 - outbound segment unused; 3 - inbound segment unused', example='2'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable change rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable change rule end time, time unit (day/hour)', example='12'),
      canChange?: boolean(name='can_change', description='whether changeable X-Y hour(day) before departure', example='true'),
      changeFee?: double(name='change_fee', description='change fee X-Y hour(day) before departure', example='100'),
    }
  ](name='change_rule_out_unused_list', description='change rule for outbound-flight-unused tickets'),
}

model DataSolutionSegmentBaggageMappingListPassengerBaggageAllowanceMappingValue = {
  baggageAmount?: int32(name='baggage_amount', description='checked baggage quantity', example='1'),
  baggageWeight?: int32(name='baggage_weight', description='checked baggage weight', example='10'),
  baggageWeightUnit?: string(name='baggage_weight_unit', description='checked baggage weight unit', example='KG'),
  isAllWeight?: boolean(name='is_all_weight', description='Whether the weight is for all baggages', example='true'),
  carryOnAmount?: int32(name='carry_on_amount', description='carry-on baggage quantity', example='1'),
  carryOnWeight?: int32(name='carry_on_weight', description='carry-on baggage weight', example='5'),
  carryOnWeightUnit?: string(name='carry_on_weight_unit', description='carry-on baggage weight unit', example='KG'),
  isAllCarryOnWeight?: boolean(name='is_all_carry_on_weight', description='Whether the weight is for all baggages', example='true'),
}

model DataSolutionSegmentRefundChangeRuleMappingListRefundChangeRuleMapValue = {
  refundRuleAllUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 0 - fully-unused ticket; 1 - partially used ticket', example='0'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable refund rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable refund rule end time, time unit (day/hour)', example='12'),
      canRefund?: boolean(name='can_refund', description='whether refundable X-Y hour(day) before departure', example='true'),
      refundFee?: double(name='refund_fee', description='refund fee X-Y hour(day) before departure', example='200'),
      canReturnAllTax?: boolean(name='can_return_all_tax', description='whether tax is fully refundable X-Y hour(day) before departure', example='true'),
      returnPartTaxFee?: double(name='return_part_tax_fee', description='tax amount refundable X-Y hour(day) before departure', example='100'),
    }
  ](name='refund_rule_all_unused_list', description='refund rule for fully-unused tickets'),
  refundRulePartUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 0 - fully-unused ticket; 1 - partially used ticket', example='0'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable refund rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable refund rule end time, time unit (day/hour)', example='12'),
      canRefund?: boolean(name='can_refund', description='whether refundable X-Y hour(day) before departure', example='true'),
      refundFee?: double(name='refund_fee', description='refund fee X-Y hour(day) before departure', example='200'),
      canReturnAllTax?: boolean(name='can_return_all_tax', description='whether tax is fully refundable X-Y hour(day) before departure', example='true'),
      returnPartTaxFee?: double(name='return_part_tax_fee', description='tax amount refundable X-Y hour(day) before departure', example='100'),
    }
  ](name='refund_rule_part_unused_list', description='refund rule for partially-used tickets'),
  changeRuleInUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 2 - outbound segment unused; 3 - inbound segment unused', example='2'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable change rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable change rule end time, time unit (day/hour)', example='12'),
      canChange?: boolean(name='can_change', description='whether changeable X-Y hour(day) before departure', example='true'),
      changeFee?: double(name='change_fee', description='change fee X-Y hour(day) before departure', example='100'),
    }
  ](name='change_rule_in_unused_list', description='change rule for inbound segment unused tickets'),
  changeRuleOutUnusedList?: [ 
    {
      type?: int32(name='type', description='type: 2 - outbound segment unused; 3 - inbound segment unused', example='2'),
      timeUnit?: string(name='time_unit', description='time unit: day/hour', example='hour'),
      ruleStartTime?: int32(name='rule_start_time', description='applicable change rule start time, time unit (day/hour)', example='36'),
      ruleEndTime?: int32(name='rule_end_time', description='applicable change rule end time, time unit (day/hour)', example='12'),
      canChange?: boolean(name='can_change', description='whether changeable X-Y hour(day) before departure', example='true'),
      changeFee?: double(name='change_fee', description='change fee X-Y hour(day) before departure', example='100'),
    }
  ](name='change_rule_out_unused_list', description='change rule for outbound-flight-unused tickets'),
}

model AccountFlowListHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model AccountFlowListRequest {
  dayNum?: int32(name='day_num', description='This parameter is required.', example='0'),
  pageIndex?: int32(name='page_index', example='1'),
  pageSize?: int32(name='page_size', example='20'),
  utcBeginTime?: long(name='utc_begin_time', description='This parameter is required.', example='1677427200000'),
}

model AccountFlowListResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    list?: [ 
      {
        afterAvailableAmount?: double(name='after_available_amount', example='1000'),
        beforeAvailableAmount?: double(name='before_available_amount', example='1950.5'),
        changeOrderNum?: long(name='change_order_num', example='49880***971'),
        flowId?: long(name='flow_id', example='1627239841225842666'),
        gmtCreate?: long(name='gmt_create', example='1676799185000'),
        gmtModified?: long(name='gmt_modified', example='1676966530000'),
        opAmount?: double(name='op_amount', example='950.5'),
        opType?: int32(name='op_type', example='2'),
        orderNum?: long(name='order_num', example='4988430***971'),
        orderType?: int32(name='order_type', example='1'),
        outOrderNum?: string(name='out_order_num', example='4988430***971'),
        refundOrderNum?: long(name='refund_order_num', example='48430***971'),
      }
    ](name='list'),
    pagination?: {
      currentPage?: int32(name='current_page', example='1'),
      pageSize?: int32(name='page_size', example='10'),
      totalCount?: int32(name='total_count', example='5'),
      totalPage?: int32(name='total_page', example='1'),
    }(name='pagination'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model AccountFlowListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AccountFlowListResponseBody(name='body'),
}

/**
 * @summary 账号资金流水
 *
 * @param request AccountFlowListRequest
 * @param headers AccountFlowListHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return AccountFlowListResponse
 */
async function accountFlowListWithOptions(request: AccountFlowListRequest, headers: AccountFlowListHeaders, runtime: Util.RuntimeOptions): AccountFlowListResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.dayNum)) {
    query['day_num'] = request.dayNum;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['page_index'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }
  if (!Util.isUnset(request.utcBeginTime)) {
    query['utc_begin_time'] = request.utcBeginTime;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AccountFlowList',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/account/flow-list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 账号资金流水
 *
 * @param request AccountFlowListRequest
 * @return AccountFlowListResponse
 */
async function accountFlowList(request: AccountFlowListRequest): AccountFlowListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AccountFlowListHeaders{};
  return accountFlowListWithOptions(request, headers, runtime);
}

model AncillarySuggestHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='Language Code(refer to ISO_639)', example='en_US'),
}

model AncillarySuggestRequest {
  solutionId?: string(name='solution_id', description='solution_id returned by enrich

This parameter is required.', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
}

model AncillarySuggestResponseBody = {
  requestId?: string(name='RequestId', description='Request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    segAncillaryMapList?: [ 
      {
        ancillary?: {
          ancillaryId?: string(name='ancillary_id', description='Ancillary product ID', example='eJwz8DeySEo0NjQ01TU3TU'),
          ancillaryType?: int32(name='ancillary_type', description='Ancillary product type. currently supports 4: paid luggage', example='4'),
          baggageAncillary?: {
            baggageAmount?: int32(name='baggage_amount', description='baggage quantity, values such as: 3, 2, 1, 0, -2.     -2 indicates weight-based', example='0'),
            baggageWeight?: int32(name='baggage_weight', description='Baggage weight, 0-50. When isAllWeight=true, it represents the total weight of all baggages.', example='0'),
            baggageWeightUnit?: string(name='baggage_weight_unit', description='Unit of baggage weight', example='KG'),
            isAllWeight?: boolean(name='is_all_weight', description='Whether the weight is for all baggages', example='true'),
            price?: double(name='price', description='Total price', example='10.0'),
          }(name='baggage_ancillary', description='Baggage details'),
        }(name='ancillary', description='Ancillary product'),
        segmentIdList?: [ string ](name='segment_id_list', description='Segment ID list, these segments share the same ancillary'),
      }
    ](name='seg_ancillary_map_list', description='ancillary detail list'),
    solutionId?: string(name='solution_id', description='solution_id, equals to solution_id in request', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
  }(name='data', description='Properly processed return data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='Data carried in error handling', example='null'),
  errorMsg?: string(name='error_msg', description='Error message', example='null'),
  status?: int32(name='status', description='http request successful, status value is always 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model AncillarySuggestResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AncillarySuggestResponseBody(name='body'),
}

/**
 * @summary Ancillary - Suggestion
 *
 * @description search ancillary for selected solution, you should enter the solution_id returned by enrich.
 *
 * @param request AncillarySuggestRequest
 * @param headers AncillarySuggestHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return AncillarySuggestResponse
 */
async function ancillarySuggestWithOptions(request: AncillarySuggestRequest, headers: AncillarySuggestHeaders, runtime: Util.RuntimeOptions): AncillarySuggestResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.solutionId)) {
    body['solution_id'] = request.solutionId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AncillarySuggest',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/ancillary/action-suggest`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Ancillary - Suggestion
 *
 * @description search ancillary for selected solution, you should enter the solution_id returned by enrich.
 *
 * @param request AncillarySuggestRequest
 * @return AncillarySuggestResponse
 */
async function ancillarySuggest(request: AncillarySuggestRequest): AncillarySuggestResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new AncillarySuggestHeaders{};
  return ancillarySuggestWithOptions(request, headers, runtime);
}

model BookHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model BookRequest {
  contact?: {
    email?: string(name='email', description='email address', example='gao******@gmail.com'),
    firstName?: string(name='first_name', description='first name', example='SAN'),
    lastName?: string(name='last_name', description='last name', example='ZHANG'),
    mobileCountryCode?: string(name='mobile_country_code', description='country code', example='86'),
    mobilePhoneNum?: string(name='mobile_phone_num', description='mobile phone number', example='183******96'),
  }(name='contact', description='contact information

This parameter is required.'),
  outOrderNum?: string(name='out_order_num', description='external order number(buyer customization)

This parameter is required.', example='x091-2023-0220-j-0001'),
  passengerAncillaryPurchaseMapList?: [ 
    {
      bookAncillaryReqItem?: {
        ancillaryId?: string(name='ancillary_id', description='ancillary product ID, returned by AncillarySuggest.', example='MDY2NTAxLCJleHAiOjE2NxNzM3MDEsIm5ix'),
        ancillaryType?: int32(name='ancillary_type', description='type of ancillary product, only support "4"(4 means paid baggage) currently.', example='4'),
      }(name='book_ancillary_req_item', description='ancillary information'),
      passengerList?: [ 
        {
          birthday?: string(name='birthday', description='date of birth (yyyyMMdd)', example='20020320'),
          credential?: {
            certIssuePlace?: string(name='cert_issue_place', description='place of issue, two-letter code', example='CN'),
            credentialNum?: string(name='credential_num', description='travel document number', example='E1***5673'),
            credentialType?: int32(name='credential_type', description='travel document type , only support "1"(1 means passport) currently

This parameter is required.', example='1'),
            expireDate?: string(name='expire_date', description='expiration date', example='20290102'),
          }(name='credential', description='travel document'),
          firstName?: string(name='first_name', description='first name

This parameter is required.', example='SAN'),
          gender?: int32(name='gender', description='gender 0: male; 1: female', example='1'),
          lastName?: string(name='last_name', description='last name

This parameter is required.', example='ZHANG'),
          mobileCountryCode?: string(name='mobile_country_code', description='country code for mobile phone number

This parameter is required.', example='86'),
          mobilePhoneNumber?: string(name='mobile_phone_number', description='mobile phone number

This parameter is required.', example='182******92'),
          nationality?: string(name='nationality', description='nationality', example='CN'),
          type?: int32(name='type', description='passenger type 0: adult; 1: child; 8: Infant

This parameter is required.', example='0'),
        }
      ](name='passenger_list', description='passenger list for unified ancillary purchases'),
    }
  ](name='passenger_ancillary_purchase_map_list', description='passenger-ancillary purchase relationship'),
  passengerList?: [ 
    {
      birthday?: string(name='birthday', description='date of birth (yyyyMMdd)', example='20200320'),
      credential?: {
        certIssuePlace?: string(name='cert_issue_place', description='place of issue, two-letter code', example='CN'),
        credentialNum?: string(name='credential_num', description='travel document number', example='E1***5674'),
        credentialType?: int32(name='credential_type', description='travel document type , only support "1"(1 means passport) currently.

This parameter is required.', example='1'),
        expireDate?: string(name='expire_date', description='expiration date', example='20290101'),
      }(name='credential', description='travel document'),
      firstName?: string(name='first_name', description='first name

This parameter is required.', example='SAN'),
      gender?: int32(name='gender', description='gender 0: MALE; 1: FEMALE', example='0'),
      lastName?: string(name='last_name', description='last name

This parameter is required.', example='ZHANG'),
      mobileCountryCode?: string(name='mobile_country_code', description='mobile country code

This parameter is required.', example='86'),
      mobilePhoneNumber?: string(name='mobile_phone_number', description='mobile phone number

This parameter is required.', example='183******95'),
      nationality?: string(name='nationality', description='nationality (two-letter code)', example='CN'),
      type?: int32(name='type', description='passenger type 0: adult; 1: child; 8: infant

This parameter is required.', example='0'),
    }
  ](name='passenger_list', description='passenger list

This parameter is required.'),
  solutionId?: string(name='solution_id', description='solution_id returned by Enrich

This parameter is required.', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
}

model BookShrinkRequest {
  contactShrink?: string(name='contact', description='contact information

This parameter is required.'),
  outOrderNum?: string(name='out_order_num', description='external order number(buyer customization)

This parameter is required.', example='x091-2023-0220-j-0001'),
  passengerAncillaryPurchaseMapListShrink?: string(name='passenger_ancillary_purchase_map_list', description='passenger-ancillary purchase relationship'),
  passengerListShrink?: string(name='passenger_list', description='passenger list

This parameter is required.'),
  solutionId?: string(name='solution_id', description='solution_id returned by Enrich

This parameter is required.', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
}

model BookResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    orderList?: [ 
      {
        orderNum?: long(name='order_num', description='order number', example='4966***617111'),
      }
    ](name='order_list', description='order information list'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: {
    orderList?: [ 
      {
        orderNum?: long(name='order_num', description='order number', example='4966***617111'),
      }
    ](name='order_list', description='order information list. When the same input parameters are used to repeat a Book, if the booking has already been successful, the order number will be returned.'),
  }(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model BookResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: BookResponseBody(name='body'),
}

/**
 * @summary Transaction-Reservation
 *
 * @description Enter solution_id returned by enrich, ancillary_id returned by ancillarySuggest(optional), passengers information and contact information, the book interface will create an order wait for pay.
 * There are two issues should be noticed:
 * 1. the solution_id must be processed by pricing.
 * 2. the order created by book interface should be pay within 30 minutes, otherwise the order will be closed.
 *
 * @param tmpReq BookRequest
 * @param headers BookHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return BookResponse
 */
async function bookWithOptions(tmpReq: BookRequest, headers: BookHeaders, runtime: Util.RuntimeOptions): BookResponse {
  Util.validateModel(tmpReq);
  var request = new BookShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.contact)) {
    request.contactShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contact, 'contact', 'json');
  }
  if (!Util.isUnset(tmpReq.passengerAncillaryPurchaseMapList)) {
    request.passengerAncillaryPurchaseMapListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.passengerAncillaryPurchaseMapList, 'passenger_ancillary_purchase_map_list', 'json');
  }
  if (!Util.isUnset(tmpReq.passengerList)) {
    request.passengerListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.passengerList, 'passenger_list', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.contactShrink)) {
    body['contact'] = request.contactShrink;
  }
  if (!Util.isUnset(request.outOrderNum)) {
    body['out_order_num'] = request.outOrderNum;
  }
  if (!Util.isUnset(request.passengerAncillaryPurchaseMapListShrink)) {
    body['passenger_ancillary_purchase_map_list'] = request.passengerAncillaryPurchaseMapListShrink;
  }
  if (!Util.isUnset(request.passengerListShrink)) {
    body['passenger_list'] = request.passengerListShrink;
  }
  if (!Util.isUnset(request.solutionId)) {
    body['solution_id'] = request.solutionId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Book',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-book`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Transaction-Reservation
 *
 * @description Enter solution_id returned by enrich, ancillary_id returned by ancillarySuggest(optional), passengers information and contact information, the book interface will create an order wait for pay.
 * There are two issues should be noticed:
 * 1. the solution_id must be processed by pricing.
 * 2. the order created by book interface should be pay within 30 minutes, otherwise the order will be closed.
 *
 * @param request BookRequest
 * @return BookResponse
 */
async function book(request: BookRequest): BookResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new BookHeaders{};
  return bookWithOptions(request, headers, runtime);
}

model CancelHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to buyer account configuration', example='en_US'),
}

model CancelRequest {
  orderNum?: long(name='order_num', description='order number

This parameter is required.', example='496***2617111'),
}

model CancelResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    orderNum?: long(name='order_num', description='order number', example='496***2617111'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model CancelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelResponseBody(name='body'),
}

/**
 * @summary Transaction - Unpaid Cancellation
 *
 * @description close an unpaid order
 *
 * @param request CancelRequest
 * @param headers CancelHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return CancelResponse
 */
async function cancelWithOptions(request: CancelRequest, headers: CancelHeaders, runtime: Util.RuntimeOptions): CancelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    body['order_num'] = request.orderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Cancel',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-cancel`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Transaction - Unpaid Cancellation
 *
 * @description close an unpaid order
 *
 * @param request CancelRequest
 * @return CancelResponse
 */
async function cancel(request: CancelRequest): CancelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CancelHeaders{};
  return cancelWithOptions(request, headers, runtime);
}

model ChangeApplyHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model ChangeApplyRequest {
  changePassengerList?: [ 
    {
      document?: string(name='document', example='411***********4411'),
      firstName?: string(name='first_name', description='This parameter is required.', example='SAN'),
      lastName?: string(name='last_name', description='This parameter is required.', example='ZHANG'),
    }
  ](name='change_passenger_list', description='This parameter is required.'),
  changedJourneys?: [ 
    {
      segmentList?: [ 
        {
          arrivalAirport?: string(name='arrival_airport', example='MFM'),
          arrivalCity?: string(name='arrival_city', description='This parameter is required.', example='MFM'),
          arriveTerminal?: string(name='arrive_terminal', example='T1'),
          arriveTime?: long(name='arrive_time', example='1677232999000'),
          arriveTimeStr?: string(name='arrive_time_str'),
          codeShare?: boolean(name='code_share', example='false'),
          departureAirport?: string(name='departure_airport', example='PVG'),
          departureCity?: string(name='departure_city', description='This parameter is required.', example='SHA'),
          departureDate?: string(name='departure_date', description='This parameter is required.', example='20230320'),
          departureTerminal?: string(name='departure_terminal', example='T2'),
          departureTime?: long(name='departure_time', example='1677232998000'),
          departureTimeStr?: string(name='departure_time_str'),
          marketingFlightNo?: string(name='marketing_flight_no', description='This parameter is required.', example='HO1295'),
          operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
        }
      ](name='segment_list'),
    }
  ](name='changed_journeys', description='This parameter is required.'),
  contact?: {
    email?: string(name='email', example='gao******@gmail.com'),
    mobileCountryCode?: string(name='mobile_country_code', example='86'),
    mobilePhoneNum?: string(name='mobile_phone_num', example='183*****92'),
  }(name='contact', description='This parameter is required.'),
  orderNum?: long(name='order_num', description='This parameter is required.', example='4988430***950'),
  remark?: string(name='remark', example='remark desc'),
  type?: int32(name='type', description='This parameter is required.', example='0'),
}

model ChangeApplyShrinkRequest {
  changePassengerListShrink?: string(name='change_passenger_list', description='This parameter is required.'),
  changedJourneysShrink?: string(name='changed_journeys', description='This parameter is required.'),
  contactShrink?: string(name='contact', description='This parameter is required.'),
  orderNum?: long(name='order_num', description='This parameter is required.', example='4988430***950'),
  remark?: string(name='remark', example='remark desc'),
  type?: int32(name='type', description='This parameter is required.', example='0'),
}

model ChangeApplyResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    changeOrders?: [ 
      {
        changeOrderNum?: long(name='change_order_num', example='49884*****950'),
        changeOrderStatus?: int32(name='change_order_status', example='0'),
        failReason?: string(name='fail_reason', example='desc reason'),
        passengers?: [ 
          {
            document?: string(name='document', example='411***********4411'),
            firstName?: string(name='first_name', example='SAN'),
            lastName?: string(name='last_name', example='ZHANG'),
          }
        ](name='passengers'),
      }
    ](name='change_orders'),
    orderNum?: long(name='order_num', example='4988430***950'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model ChangeApplyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeApplyResponseBody(name='body'),
}

/**
 * @summary 改签-Apply
 *
 * @param tmpReq ChangeApplyRequest
 * @param headers ChangeApplyHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeApplyResponse
 */
async function changeApplyWithOptions(tmpReq: ChangeApplyRequest, headers: ChangeApplyHeaders, runtime: Util.RuntimeOptions): ChangeApplyResponse {
  Util.validateModel(tmpReq);
  var request = new ChangeApplyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.changePassengerList)) {
    request.changePassengerListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.changePassengerList, 'change_passenger_list', 'json');
  }
  if (!Util.isUnset(tmpReq.changedJourneys)) {
    request.changedJourneysShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.changedJourneys, 'changed_journeys', 'json');
  }
  if (!Util.isUnset(tmpReq.contact)) {
    request.contactShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.contact, 'contact', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.changePassengerListShrink)) {
    body['change_passenger_list'] = request.changePassengerListShrink;
  }
  if (!Util.isUnset(request.changedJourneysShrink)) {
    body['changed_journeys'] = request.changedJourneysShrink;
  }
  if (!Util.isUnset(request.contactShrink)) {
    body['contact'] = request.contactShrink;
  }
  if (!Util.isUnset(request.orderNum)) {
    body['order_num'] = request.orderNum;
  }
  if (!Util.isUnset(request.remark)) {
    body['remark'] = request.remark;
  }
  if (!Util.isUnset(request.type)) {
    body['type'] = request.type;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeApply',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/change/action-apply`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改签-Apply
 *
 * @param request ChangeApplyRequest
 * @return ChangeApplyResponse
 */
async function changeApply(request: ChangeApplyRequest): ChangeApplyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ChangeApplyHeaders{};
  return changeApplyWithOptions(request, headers, runtime);
}

model ChangeCancelHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model ChangeCancelRequest {
  changeOrderNum?: long(name='change_order_num', description='This parameter is required.', example='4988430***950'),
}

model ChangeCancelResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: any(name='data', example='null'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model ChangeCancelResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeCancelResponseBody(name='body'),
}

/**
 * @summary 改签-取消
 *
 * @param request ChangeCancelRequest
 * @param headers ChangeCancelHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeCancelResponse
 */
async function changeCancelWithOptions(request: ChangeCancelRequest, headers: ChangeCancelHeaders, runtime: Util.RuntimeOptions): ChangeCancelResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.changeOrderNum)) {
    body['change_order_num'] = request.changeOrderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeCancel',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/change/action-cancel`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改签-取消
 *
 * @param request ChangeCancelRequest
 * @return ChangeCancelResponse
 */
async function changeCancel(request: ChangeCancelRequest): ChangeCancelResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ChangeCancelHeaders{};
  return changeCancelWithOptions(request, headers, runtime);
}

model ChangeConfirmHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model ChangeConfirmRequest {
  changeOrderNum?: long(name='change_order_num', description='This parameter is required.', example='4988430***950'),
}

model ChangeConfirmResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    payAmount?: double(name='pay_amount', example='30'),
    transactionNo?: string(name='transaction_no', example='hkduendkd-2023-dj0'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model ChangeConfirmResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeConfirmResponseBody(name='body'),
}

/**
 * @summary 改签-确认
 *
 * @param request ChangeConfirmRequest
 * @param headers ChangeConfirmHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeConfirmResponse
 */
async function changeConfirmWithOptions(request: ChangeConfirmRequest, headers: ChangeConfirmHeaders, runtime: Util.RuntimeOptions): ChangeConfirmResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.changeOrderNum)) {
    body['change_order_num'] = request.changeOrderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ChangeConfirm',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/change/action-confirm`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改签-确认
 *
 * @param request ChangeConfirmRequest
 * @return ChangeConfirmResponse
 */
async function changeConfirm(request: ChangeConfirmRequest): ChangeConfirmResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ChangeConfirmHeaders{};
  return changeConfirmWithOptions(request, headers, runtime);
}

model ChangeDetailHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model ChangeDetailRequest {
  changeOrderNum?: long(name='change_order_num', description='This parameter is required.', example='4988430***950'),
}

model ChangeDetailResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    changeFeeDetails?: [ 
      {
        changeFee?: {
          serviceFee?: double(name='service_fee', example='50'),
          taxFee?: double(name='tax_fee', example='20'),
          upgradeFee?: double(name='upgrade_fee', example='30'),
        }(name='change_fee'),
        passenger?: {
          document?: string(name='document', example='411***********4411'),
          firstName?: string(name='first_name', example='SAN'),
          lastName?: string(name='last_name', example='ZHANG'),
        }(name='passenger'),
      }
    ](name='change_fee_details'),
    changeOrderNum?: long(name='change_order_num', example='4988430***950'),
    changePassengers?: [ 
      {
        document?: string(name='document', example='411***********4411'),
        firstName?: string(name='first_name', example='SAN'),
        lastName?: string(name='last_name', example='ZHANG'),
      }
    ](name='change_passengers'),
    changeReasonType?: int32(name='change_reason_type', example='1'),
    changedJourneys?: [ 
      {
        segmentList?: [ 
          {
            arrivalAirport?: string(name='arrival_airport', example='MFM'),
            arrivalCity?: string(name='arrival_city', example='MFM'),
            arrivalTerminal?: string(name='arrival_terminal', example='T1'),
            arrivalTime?: string(name='arrival_time', example='2023-03-10 10:40:00'),
            availability?: string(name='availability', example='7'),
            cabin?: string(name='cabin', example='V'),
            cabinClass?: string(name='cabin_class', example='Y'),
            codeShare?: boolean(name='code_share', example='false'),
            departureAirport?: string(name='departure_airport', example='PVG'),
            departureCity?: string(name='departure_city', example='SHA'),
            departureTerminal?: string(name='departure_terminal', example='T2'),
            departureTime?: string(name='departure_time', example='2023-03-10 07:55:00'),
            equipType?: string(name='equip_type', example='32Q'),
            flightDuration?: int32(name='flight_duration', example='165'),
            marketingAirline?: string(name='marketing_airline', example='HO'),
            marketingFlightNo?: string(name='marketing_flight_no', example='HO1295'),
            marketingFlightNoInt?: int32(name='marketing_flight_no_int', example='1295'),
            operatingAirline?: string(name='operating_airline', example='HO'),
            operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
            segmentId?: string(name='segment_id', example='HO1295-PVG-MFM-20230310'),
            stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
            stopQuantity?: int32(name='stop_quantity', example='0'),
          }
        ](name='segment_list'),
        transferCount?: int32(name='transfer_count', example='0'),
      }
    ](name='changed_journeys'),
    closeReason?: string(name='close_reason', example='reason desc'),
    closeUtcTime?: long(name='close_utc_time', example='1677415244000'),
    contact?: {
      email?: string(name='email', example='gao******@gmail.com'),
      mobileCountryCode?: string(name='mobile_country_code', example='86'),
      mobilePhoneNum?: string(name='mobile_phone_num', example='183*****92'),
    }(name='contact'),
    createUtcTime?: long(name='create_utc_time', example='1677415276000'),
    lastConfirmUtcTime?: long(name='last_confirm_utc_time', example='1677415278000'),
    lastJourneys?: [ 
      {
        segmentList?: [ 
          {
            arrivalAirport?: string(name='arrival_airport', example='MFM'),
            arrivalCity?: string(name='arrival_city', example='MFM'),
            arrivalTerminal?: string(name='arrival_terminal', example='T1'),
            arrivalTime?: string(name='arrival_time', example='2023-03-10 10:40:00'),
            availability?: string(name='availability', example='7'),
            cabin?: string(name='cabin', example='V'),
            cabinClass?: string(name='cabin_class', example='Y'),
            codeShare?: boolean(name='code_share', example='false'),
            departureAirport?: string(name='departure_airport', example='PVG'),
            departureCity?: string(name='departure_city', example='SHA'),
            departureTerminal?: string(name='departure_terminal', example='T2'),
            departureTime?: string(name='departure_time', example='2023-03-10 07:55:00'),
            equipType?: string(name='equip_type', example='32Q'),
            flightDuration?: int32(name='flight_duration', example='165'),
            marketingAirline?: string(name='marketing_airline', example='HO'),
            marketingFlightNo?: string(name='marketing_flight_no', example='HO1295'),
            marketingFlightNoInt?: int32(name='marketing_flight_no_int', example='1295'),
            operatingAirline?: string(name='operating_airline', example='HO'),
            operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
            segmentId?: string(name='segment_id', example='HO1295-PVG-MFM-20230310'),
            stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
            stopQuantity?: int32(name='stop_quantity', example='0'),
          }
        ](name='segment_list'),
        transferCount?: int32(name='transfer_count', example='0'),
      }
    ](name='last_journeys'),
    orderNum?: long(name='order_num', example='5988430***541'),
    orderStatus?: int32(name='order_status', example='2'),
    originalJourneys?: [ 
      {
        segmentList?: [ 
          {
            arrivalAirport?: string(name='arrival_airport', example='MFM'),
            arrivalCity?: string(name='arrival_city', example='MFM'),
            arrivalTerminal?: string(name='arrival_terminal', example='T1'),
            arrivalTime?: string(name='arrival_time', example='2023-03-10 10:40:00'),
            availability?: string(name='availability', example='7'),
            cabin?: string(name='cabin', example='V'),
            cabinClass?: string(name='cabin_class', example='Y'),
            codeShare?: boolean(name='code_share', example='false'),
            departureAirport?: string(name='departure_airport', example='PVG'),
            departureCity?: string(name='departure_city', example='SHA'),
            departureTerminal?: string(name='departure_terminal', example='T2'),
            departureTime?: string(name='departure_time', example='2023-03-10 07:55:00'),
            equipType?: string(name='equip_type', example='32Q'),
            flightDuration?: int32(name='flight_duration', example='165'),
            marketingAirline?: string(name='marketing_airline', example='HO'),
            marketingFlightNo?: string(name='marketing_flight_no', example='HO1295'),
            marketingFlightNoInt?: int32(name='marketing_flight_no_int', example='1295'),
            operatingAirline?: string(name='operating_airline', example='HO'),
            operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
            segmentId?: string(name='segment_id', example='HO1295-PVG-MFM-20230310'),
            stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
            stopQuantity?: int32(name='stop_quantity', example='0'),
          }
        ](name='segment_list'),
        transferCount?: int32(name='transfer_count', example='0'),
      }
    ](name='original_journeys'),
    payStatus?: int32(name='pay_status', example='2'),
    paySuccessUtcTime?: long(name='pay_success_utc_time', example='1677415255000'),
    totalAmount?: double(name='total_amount', example='300'),
    transactionNo?: string(name='transaction_no', example='hkduendkd-2023-dj0'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model ChangeDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeDetailResponseBody(name='body'),
}

/**
 * @summary 改签-Detail
 *
 * @param request ChangeDetailRequest
 * @param headers ChangeDetailHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeDetailResponse
 */
async function changeDetailWithOptions(request: ChangeDetailRequest, headers: ChangeDetailHeaders, runtime: Util.RuntimeOptions): ChangeDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.changeOrderNum)) {
    query['change_order_num'] = request.changeOrderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeDetail',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/change/detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改签-Detail
 *
 * @param request ChangeDetailRequest
 * @return ChangeDetailResponse
 */
async function changeDetail(request: ChangeDetailRequest): ChangeDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ChangeDetailHeaders{};
  return changeDetailWithOptions(request, headers, runtime);
}

model ChangeDetailListOfBuyerHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model ChangeDetailListOfBuyerRequest {
  pageIndex?: int32(name='page_index', example='1'),
  pageSize?: int32(name='page_size', example='10'),
  utcCreateBegin?: long(name='utc_create_begin', example='1677415276000'),
  utcCreateEnd?: long(name='utc_create_end', example='1677415279000'),
}

model ChangeDetailListOfBuyerResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    list?: [ 
      {
        changeOrderNum?: long(name='change_order_num', example='4988430***950'),
        orderNum?: long(name='order_num', example='4988430***971'),
        orderStatus?: int32(name='order_status', example='2'),
        payStatus?: int32(name='pay_status', example='2'),
        transactionNo?: string(name='transaction_no', example='hkduendkd-2023-dj0'),
        utcCreateTime?: long(name='utc_create_time', example='1677415274000'),
      }
    ](name='list'),
    pagination?: {
      currentPage?: int32(name='current_page', example='1'),
      pageSize?: int32(name='page_size', example='10'),
      totalCount?: int32(name='total_count', example='5'),
      totalPage?: int32(name='total_page', example='1'),
    }(name='pagination'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model ChangeDetailListOfBuyerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeDetailListOfBuyerResponseBody(name='body'),
}

/**
 * @summary 改签单列表-关于买家账号
 *
 * @param request ChangeDetailListOfBuyerRequest
 * @param headers ChangeDetailListOfBuyerHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeDetailListOfBuyerResponse
 */
async function changeDetailListOfBuyerWithOptions(request: ChangeDetailListOfBuyerRequest, headers: ChangeDetailListOfBuyerHeaders, runtime: Util.RuntimeOptions): ChangeDetailListOfBuyerResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.pageIndex)) {
    query['page_index'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }
  if (!Util.isUnset(request.utcCreateBegin)) {
    query['utc_create_begin'] = request.utcCreateBegin;
  }
  if (!Util.isUnset(request.utcCreateEnd)) {
    query['utc_create_end'] = request.utcCreateEnd;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeDetailListOfBuyer',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/change/buyer/detail-list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改签单列表-关于买家账号
 *
 * @param request ChangeDetailListOfBuyerRequest
 * @return ChangeDetailListOfBuyerResponse
 */
async function changeDetailListOfBuyer(request: ChangeDetailListOfBuyerRequest): ChangeDetailListOfBuyerResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ChangeDetailListOfBuyerHeaders{};
  return changeDetailListOfBuyerWithOptions(request, headers, runtime);
}

model ChangeDetailListOfOrderNumHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model ChangeDetailListOfOrderNumRequest {
  orderNum?: long(name='order_num', description='This parameter is required.', example='4988430***700'),
  pageIndex?: int32(name='page_index', example='1'),
  pageSize?: int32(name='page_size', example='20'),
}

model ChangeDetailListOfOrderNumResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    list?: [ 
      {
        changeFeeDetails?: [ 
          {
            changeFee?: {
              serviceFee?: double(name='service_fee', example='50'),
              taxFee?: double(name='tax_fee', example='20'),
              upgradeFee?: double(name='upgrade_fee', example='30'),
            }(name='change_fee'),
            passenger?: {
              document?: string(name='document', example='411***********4411'),
              firstName?: string(name='first_name', example='SAN'),
              lastName?: string(name='last_name', example='ZHANG'),
            }(name='passenger'),
          }
        ](name='change_fee_details'),
        changeOrderNum?: long(name='change_order_num', example='4988430***950'),
        changePassengers?: [ 
          {
            document?: string(name='document', example='411***********4411'),
            firstName?: string(name='first_name', example='SAN'),
            lastName?: string(name='last_name', example='ZHANG'),
          }
        ](name='change_passengers'),
        changeReasonType?: int32(name='change_reason_type', example='1'),
        changedJourneys?: [ 
          {
            segmentList?: [ 
              {
                arrivalAirport?: string(name='arrival_airport', example='MFM'),
                arrivalCity?: string(name='arrival_city', example='MFM'),
                arrivalTerminal?: string(name='arrival_terminal', example='T1'),
                arrivalTime?: string(name='arrival_time', example='2023-03-10 10:40:00'),
                availability?: string(name='availability', example='7'),
                cabin?: string(name='cabin', example='V'),
                cabinClass?: string(name='cabin_class', example='Y'),
                codeShare?: boolean(name='code_share', example='false'),
                departureAirport?: string(name='departure_airport', example='PVG'),
                departureCity?: string(name='departure_city', example='SHA'),
                departureTerminal?: string(name='departure_terminal', example='T2'),
                departureTime?: string(name='departure_time', example='2023-03-10 07:55:00'),
                equipType?: string(name='equip_type', example='32Q'),
                flightDuration?: int32(name='flight_duration', example='165'),
                marketingAirline?: string(name='marketing_airline', example='HO'),
                marketingFlightNo?: string(name='marketing_flight_no', example='HO1295'),
                marketingFlightNoInt?: int32(name='marketing_flight_no_int', example='1295'),
                operatingAirline?: string(name='operating_airline', example='HO'),
                operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
                segmentId?: string(name='segment_id', example='HO1295-PVG-MFM-20230310'),
                stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
                stopQuantity?: int32(name='stop_quantity', example='0'),
              }
            ](name='segment_list'),
            transferCount?: int32(name='transfer_count', example='0'),
          }
        ](name='changed_journeys'),
        closeReason?: string(name='close_reason', example='reason desc'),
        closeUtcTime?: long(name='close_utc_time', example='1677415244000'),
        contact?: {
          email?: string(name='email', example='gao******@gmail.com'),
          mobileCountryCode?: string(name='mobile_country_code', example='86'),
          mobilePhoneNum?: string(name='mobile_phone_num', example='183*****92'),
        }(name='contact'),
        createUtcTime?: long(name='create_utc_time', example='1677415276000'),
        lastConfirmUtcTime?: long(name='last_confirm_utc_time', example='1677415278000'),
        lastJourneys?: [ 
          {
            segmentList?: [ 
              {
                arrivalAirport?: string(name='arrival_airport', example='MFM'),
                arrivalCity?: string(name='arrival_city', example='MFM'),
                arrivalTerminal?: string(name='arrival_terminal', example='T1'),
                arrivalTime?: string(name='arrival_time', example='2023-03-10 10:40:00'),
                availability?: string(name='availability', example='7'),
                cabin?: string(name='cabin', example='V'),
                cabinClass?: string(name='cabin_class', example='Y'),
                codeShare?: boolean(name='code_share', example='false'),
                departureAirport?: string(name='departure_airport', example='PVG'),
                departureCity?: string(name='departure_city', example='SHA'),
                departureTerminal?: string(name='departure_terminal', example='T2'),
                departureTime?: string(name='departure_time', example='2023-03-10 07:55:00'),
                equipType?: string(name='equip_type', example='32Q'),
                flightDuration?: int32(name='flight_duration', example='165'),
                marketingAirline?: string(name='marketing_airline', example='HO'),
                marketingFlightNo?: string(name='marketing_flight_no', example='HO1295'),
                marketingFlightNoInt?: int32(name='marketing_flight_no_int', example='1295'),
                operatingAirline?: string(name='operating_airline', example='HO'),
                operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
                segmentId?: string(name='segment_id', example='HO1295-PVG-MFM-20230310'),
                stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
                stopQuantity?: int32(name='stop_quantity', example='0'),
              }
            ](name='segment_list'),
            transferCount?: int32(name='transfer_count', example='0'),
          }
        ](name='last_journeys'),
        orderNum?: long(name='order_num', example='5988430***541'),
        orderStatus?: int32(name='order_status', example='2'),
        originalJourneys?: [ 
          {
            segmentList?: [ 
              {
                arrivalAirport?: string(name='arrival_airport', example='MFM'),
                arrivalCity?: string(name='arrival_city', example='MFM'),
                arrivalTerminal?: string(name='arrival_terminal', example='T1'),
                arrivalTime?: string(name='arrival_time', example='2023-03-10 10:40:00'),
                availability?: string(name='availability', example='7'),
                cabin?: string(name='cabin', example='V'),
                cabinClass?: string(name='cabin_class', example='Y'),
                codeShare?: boolean(name='code_share', example='false'),
                departureAirport?: string(name='departure_airport', example='PVG'),
                departureCity?: string(name='departure_city', example='SHA'),
                departureTerminal?: string(name='departure_terminal', example='T2'),
                departureTime?: string(name='departure_time', example='2023-03-10 07:55:00'),
                equipType?: string(name='equip_type', example='32Q'),
                flightDuration?: int32(name='flight_duration', example='165'),
                marketingAirline?: string(name='marketing_airline', example='HO'),
                marketingFlightNo?: string(name='marketing_flight_no', example='HO1295'),
                marketingFlightNoInt?: int32(name='marketing_flight_no_int', example='1295'),
                operatingAirline?: string(name='operating_airline', example='HO'),
                operatingFlightNo?: string(name='operating_flight_no', example='HO1295'),
                segmentId?: string(name='segment_id', example='HO1295-PVG-MFM-20230310'),
                stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
                stopQuantity?: int32(name='stop_quantity', example='0'),
              }
            ](name='segment_list'),
            transferCount?: int32(name='transfer_count', example='0'),
          }
        ](name='original_journeys'),
        payStatus?: int32(name='pay_status', example='2'),
        paySuccessUtcTime?: long(name='pay_success_utc_time', example='1677415255000'),
        totalAmount?: double(name='total_amount', example='300'),
        transactionNo?: string(name='transaction_no', example='hkduendkd-2023-dj0'),
      }
    ](name='list'),
    pagination?: {
      currentPage?: int32(name='current_page', example='1'),
      pageSize?: int32(name='page_size', example='10'),
      totalCount?: int32(name='total_count', example='5'),
      totalPage?: int32(name='total_page', example='1'),
    }(name='pagination'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model ChangeDetailListOfOrderNumResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeDetailListOfOrderNumResponseBody(name='body'),
}

/**
 * @summary 改签单列表-关于正向订单
 *
 * @param request ChangeDetailListOfOrderNumRequest
 * @param headers ChangeDetailListOfOrderNumHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeDetailListOfOrderNumResponse
 */
async function changeDetailListOfOrderNumWithOptions(request: ChangeDetailListOfOrderNumRequest, headers: ChangeDetailListOfOrderNumHeaders, runtime: Util.RuntimeOptions): ChangeDetailListOfOrderNumResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    query['order_num'] = request.orderNum;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['page_index'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeDetailListOfOrderNum',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/change/order-num/detail-list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 改签单列表-关于正向订单
 *
 * @param request ChangeDetailListOfOrderNumRequest
 * @return ChangeDetailListOfOrderNumResponse
 */
async function changeDetailListOfOrderNum(request: ChangeDetailListOfOrderNumRequest): ChangeDetailListOfOrderNumResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new ChangeDetailListOfOrderNumHeaders{};
  return changeDetailListOfOrderNumWithOptions(request, headers, runtime);
}

model CollectFlightLowestPriceHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model CollectFlightLowestPriceRequest {
  lowestPriceFlightInfoList?: [ 
    {
      arrivalCity?: string(name='arrival_city', description='This parameter is required.', example='MFM'),
      departureCity?: string(name='departure_city', description='This parameter is required.', example='SHA'),
      departureDate?: string(name='departure_date', description='This parameter is required.', example='2024-11-11'),
      departureFlightNumber?: string(name='departure_flight_number', description='This parameter is required.', example='CA123,CA456'),
      marketTotalPrice?: double(name='market_total_price', description='This parameter is required.', example='100.0'),
      requestId?: string(name='request_id', example='123456789dacd'),
      returnDate?: string(name='return_date', example='2024-11-11'),
      returnFlightNumber?: string(name='return_flight_number', example='CA123,CA456'),
      solutionId?: string(name='solution_id', description='This parameter is required.', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
      suezTotalPrice?: double(name='suez_total_price', description='This parameter is required.', example='100.1'),
      tripType?: int32(name='trip_type', description='This parameter is required.', example='1'),
    }
  ](name='lowest_price_flight_info_list', description='This parameter is required.'),
}

model CollectFlightLowestPriceShrinkRequest {
  lowestPriceFlightInfoListShrink?: string(name='lowest_price_flight_info_list', description='This parameter is required.'),
}

model CollectFlightLowestPriceResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: map[string]any(name='data', example='null'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model CollectFlightLowestPriceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CollectFlightLowestPriceResponseBody(name='body'),
}

/**
 * @summary 数据收集-低价航班信息
 *
 * @param tmpReq CollectFlightLowestPriceRequest
 * @param headers CollectFlightLowestPriceHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return CollectFlightLowestPriceResponse
 */
async function collectFlightLowestPriceWithOptions(tmpReq: CollectFlightLowestPriceRequest, headers: CollectFlightLowestPriceHeaders, runtime: Util.RuntimeOptions): CollectFlightLowestPriceResponse {
  Util.validateModel(tmpReq);
  var request = new CollectFlightLowestPriceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.lowestPriceFlightInfoList)) {
    request.lowestPriceFlightInfoListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.lowestPriceFlightInfoList, 'lowest_price_flight_info_list', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.lowestPriceFlightInfoListShrink)) {
    body['lowest_price_flight_info_list'] = request.lowestPriceFlightInfoListShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CollectFlightLowestPrice',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/data-collect/flight-lowest-price`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 数据收集-低价航班信息
 *
 * @param request CollectFlightLowestPriceRequest
 * @return CollectFlightLowestPriceResponse
 */
async function collectFlightLowestPrice(request: CollectFlightLowestPriceRequest): CollectFlightLowestPriceResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new CollectFlightLowestPriceHeaders{};
  return collectFlightLowestPriceWithOptions(request, headers, runtime);
}

model EnrichHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model EnrichRequest {
  adults?: int32(name='adults', description='adult passenger amount 1-9', example='1'),
  cabinClass?: string(name='cabin_class', description='cabin class
1. **ALL_CABIN** : all cabin class
2. **Y** : economy class
3. **FC** : first class and business class
4. **S** : premium economy class
5. **YS** : economy class and premium economy class
6. **YSC** : economy class, premium economy class and business class', example='ALL_CABIN'),
  children?: int32(name='children', description='child passenger amount 0-9', example='1'),
  infants?: int32(name='infants', description='infant passenger amount 0-9', example='1'),
  journeyParamList?: [ 
    {
      arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)

This parameter is required.', example='MFM'),
      departureCity?: string(name='departure_city', description='departure city code (capitalized)

This parameter is required.', example='SHA'),
      departureDate?: string(name='departure_date', description='departure date (eg: yyyyMMdd)

This parameter is required.', example='20230310'),
      segmentParamList?: [ 
        {
          arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)', example='MFM'),
          arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)', example='MFM'),
          cabin?: string(name='cabin', description='RBD', example='V'),
          childCabin?: string(name='child_cabin', description='child RBD', example='E'),
          departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)', example='PVG'),
          departureCity?: string(name='departure_city', description='departure city code (capitalized)', example='SHA'),
          departureTime?: string(name='departure_time', description='departure time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 07:55:00'),
          marketingFlightNo?: string(name='marketing_flight_no', description='marketing flight no. (eg: KA5809)

This parameter is required.', example='HO1295'),
        }
      ](name='segment_param_list', description='segement param list

This parameter is required.'),
    }
  ](name='journey_param_list', description='journey list'),
  solutionId?: string(name='solution_id', description='solution_id returned by Search', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
}

model EnrichShrinkRequest {
  adults?: int32(name='adults', description='adult passenger amount 1-9', example='1'),
  cabinClass?: string(name='cabin_class', description='cabin class
1. **ALL_CABIN** : all cabin class
2. **Y** : economy class
3. **FC** : first class and business class
4. **S** : premium economy class
5. **YS** : economy class and premium economy class
6. **YSC** : economy class, premium economy class and business class', example='ALL_CABIN'),
  children?: int32(name='children', description='child passenger amount 0-9', example='1'),
  infants?: int32(name='infants', description='infant passenger amount 0-9', example='1'),
  journeyParamListShrink?: string(name='journey_param_list', description='journey list'),
  solutionId?: string(name='solution_id', description='solution_id returned by Search', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
}

model EnrichResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    solutionList?: [ 
      {
        adultPrice?: double(name='adult_price', description='adult fare', example='500'),
        adultTax?: double(name='adult_tax', description='adult tax', example='100'),
        childPrice?: double(name='child_price', description='child fare', example='100'),
        childTax?: double(name='child_tax', description='child tax', example='100'),
        infantPrice?: double(name='infant_price', description='infant fare', example='500'),
        infantTax?: double(name='infant_tax', description='infant tax', example='100'),
        journeyList?: [ 
          {
            segmentList?: [ 
              {
                arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)', example='MFM'),
                arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)', example='MFM'),
                arrivalTerminal?: string(name='arrival_terminal', description='arrival terminal', example='T1'),
                arrivalTime?: string(name='arrival_time', description='arrival time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 10:40:00'),
                availability?: string(name='availability', description='available seats (for reference only)', example='7'),
                cabin?: string(name='cabin', description='RBD', example='V'),
                cabinClass?: string(name='cabin_class', description='cabin class', example='Y'),
                codeShare?: boolean(name='code_share', description='code share or not', example='false'),
                departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)', example='PVG'),
                departureCity?: string(name='departure_city', description='departure city code (capitalized)', example='SHA'),
                departureTerminal?: string(name='departure_terminal', description='departure terminal', example='T2'),
                departureTime?: string(name='departure_time', description='departure time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 07:55:00'),
                equipType?: string(name='equip_type', description='equipment type', example='32Q'),
                flightDuration?: int32(name='flight_duration', description='flight time, unit: minute', example='165'),
                marketingAirline?: string(name='marketing_airline', description='marketing airline code (eg: KA)', example='HO'),
                marketingFlightNo?: string(name='marketing_flight_no', description='marketing airline flight no. (eg: KA5809)', example='HO1295'),
                marketingFlightNoInt?: int32(name='marketing_flight_no_int', description='marketing airline integer flight no. (eg: 5809)', example='1295'),
                operatingAirline?: string(name='operating_airline', description='operating airline code (eg: CX)', example='HO'),
                operatingFlightNo?: string(name='operating_flight_no', description='operating airline flight no. (eg: CX601)', example='HO1295'),
                segmentId?: string(name='segment_id', description='segment ID format: flight no.+departure airport[IATA airport code]+arrival airport[IATA airport code]+departure time(MMdd)', example='HO1295-PVG-MFM-20230310'),
                stopCityList?: string(name='stop_city_list', description='stop city list. 
when stop_quantity > 1 , use “,” for seperation', example='MFM,PVG'),
                stopQuantity?: int32(name='stop_quantity', description='number of stops', example='0'),
              }
            ](name='segment_list', description='segment Info'),
            transferCount?: int32(name='transfer_count', description='number of transfers', example='0'),
          }
        ](name='journey_list', description='journey list'),
        productTypeDescription?: string(name='product_type_description', description='product type description', example='""'),
        refundTicketCouponDescription?: string(name='refund_ticket_coupon_description', description='refund airline coupon description', example='""'),
        segmentBaggageCheckInInfoList?: [ 
          {
            luggageDirectInfoType?: int32(name='luggage_direct_info_type', description='through check-in baggage policy type
1. baggage through check-in between segments
2. baggage re-check-in needed between segments
4. baggage through check-in at stop city ( applies for stop flight )
3. baggage re-checkin needed at stop city ( applies for stop flight )', example='1'),
            segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same baggage through check-in policy'),
          }
        ](name='segment_baggage_check_in_info_list', description='through check-in baggage  policy'),
        segmentBaggageMappingList?: [ 
          {
            passengerBaggageAllowanceMapping?: map[string]DataSolutionListSegmentBaggageMappingListPassengerBaggageAllowanceMappingValue(name='passenger_baggage_allowance_mapping', description='baggage rule mapping, key is passenger type, value is baggage allowance details'),
            segmentIdList?: [ string ](name='segment_id_list', description='segment id list. 
all the listed segment ids share the same baggage rule'),
          }
        ](name='segment_baggage_mapping_list', description='baggage rule'),
        segmentRefundChangeRuleMappingList?: [ 
          {
            refundChangeRuleMap?: map[string]DataSolutionListSegmentRefundChangeRuleMappingListRefundChangeRuleMapValue(name='refund_change_rule_map', description='change and refund policy mapping, key is passenger type, value is change and refund policy detail'),
            segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same change and refund policy'),
          }
        ](name='segment_refund_change_rule_mapping_list', description='change and refund policy'),
        solutionId?: string(name='solution_id', description='solution ID', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
      }
    ](name='solution_list', description='solution list'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model EnrichResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: EnrichResponseBody(name='body'),
}

/**
 * @summary Search-Enrich
 *
 * @description Enrich supports two modes:
 * 1. mode1: enter solution_id returned by Search.
 * 2. mode2: enter journeyParamList.
 * If you already confirm which flight to fly with, then you can use mode2, otherwise, use mode1(search first, then chose one solution_ID and Enrich).
 *
 * @param tmpReq EnrichRequest
 * @param headers EnrichHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return EnrichResponse
 */
async function enrichWithOptions(tmpReq: EnrichRequest, headers: EnrichHeaders, runtime: Util.RuntimeOptions): EnrichResponse {
  Util.validateModel(tmpReq);
  var request = new EnrichShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.journeyParamList)) {
    request.journeyParamListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.journeyParamList, 'journey_param_list', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.adults)) {
    body['adults'] = request.adults;
  }
  if (!Util.isUnset(request.cabinClass)) {
    body['cabin_class'] = request.cabinClass;
  }
  if (!Util.isUnset(request.children)) {
    body['children'] = request.children;
  }
  if (!Util.isUnset(request.infants)) {
    body['infants'] = request.infants;
  }
  if (!Util.isUnset(request.journeyParamListShrink)) {
    body['journey_param_list'] = request.journeyParamListShrink;
  }
  if (!Util.isUnset(request.solutionId)) {
    body['solution_id'] = request.solutionId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Enrich',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-enrich`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Search-Enrich
 *
 * @description Enrich supports two modes:
 * 1. mode1: enter solution_id returned by Search.
 * 2. mode2: enter journeyParamList.
 * If you already confirm which flight to fly with, then you can use mode2, otherwise, use mode1(search first, then chose one solution_ID and Enrich).
 *
 * @param request EnrichRequest
 * @return EnrichResponse
 */
async function enrich(request: EnrichRequest): EnrichResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new EnrichHeaders{};
  return enrichWithOptions(request, headers, runtime);
}

model FileUploadHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model FileUploadRequest {
  fileContent?: string(name='file_content', description='This parameter is required.', example='0r2LSuIsHlxEoGZcnGe34U1njBOR83Q4HNSvMDGrDPK5J71VjcGdRIWz2x3+tFxvQaduwHB46Z9K
dbIoDN8xPQ5PWlky8rKOPmAqSZfIRyPmAwvPvTJFwr8bRgHPPaq2VO8kHJ6jFIpJJ5I7Zqd1BjGS
SR/kULQZHsDDd2zgA9RRTsEQF2OSxFFFx2P/2Q=='),
  orderNum?: long(name='order_num', description='This parameter is required.', example='496***2617111'),
}

model FileUploadResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    uploadedFileUrl?: string(name='uploaded_file_url', example='https://fliggy-flight-jinghang-bucket.oss-cn-zhangjiakou.aliyuncs.com/suez/flight_suez_9a634376****47.jpeg'),
  }(name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model FileUploadResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FileUploadResponseBody(name='body'),
}

/**
 * @summary 附件上传
 *
 * @param request FileUploadRequest
 * @param headers FileUploadHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return FileUploadResponse
 */
async function fileUploadWithOptions(request: FileUploadRequest, headers: FileUploadHeaders, runtime: Util.RuntimeOptions): FileUploadResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.fileContent)) {
    body['file_content'] = request.fileContent;
  }
  if (!Util.isUnset(request.orderNum)) {
    body['order_num'] = request.orderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'FileUpload',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/attachment/action-upload`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 附件上传
 *
 * @param request FileUploadRequest
 * @return FileUploadResponse
 */
async function fileUpload(request: FileUploadRequest): FileUploadResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new FileUploadHeaders{};
  return fileUploadWithOptions(request, headers, runtime);
}

model FlightChangeOfOrderHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model FlightChangeOfOrderRequest {
  orderNum?: long(name='order_num', description='This parameter is required.', example='4966***617111'),
}

model FlightChangeOfOrderResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: [ 
    {
      flightChangeDetail?: {
        changeReason?: string(name='change_reason', example='天气'),
        changeTime?: string(name='change_time', example='2023-02-01 10:01:00'),
        changeType?: int32(name='change_type', example='1'),
        newArrivalAirport?: string(name='new_arrival_airport', example='MFM'),
        newArrivalTime?: string(name='new_arrival_time', example='2023-02-01 15:01:00'),
        newDepartureAirport?: string(name='new_departure_airport', example='PVG'),
        newDepartureTime?: string(name='new_departure_time', example='2023-02-01 13:01:00'),
        newFlightNo?: string(name='new_flight_no', example='HO1295'),
        oldArrivalAirport?: string(name='old_arrival_airport', example='MFM'),
        oldArrivalTime?: string(name='old_arrival_time', example='023-02-01 14:01:00'),
        oldDepartureAirport?: string(name='old_departure_airport', example='PVG'),
        oldDepartureTime?: string(name='old_departure_time', example='2023-02-01 12:01:00'),
        oldFlightNo?: string(name='old_flight_no', example='HO1295'),
      }(name='flight_change_detail'),
      orderNum?: long(name='order_num', example='4966***617111'),
    }
  ](name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model FlightChangeOfOrderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: FlightChangeOfOrderResponseBody(name='body'),
}

/**
 * @summary 航变信息-关于订单
 *
 * @param request FlightChangeOfOrderRequest
 * @param headers FlightChangeOfOrderHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return FlightChangeOfOrderResponse
 */
async function flightChangeOfOrderWithOptions(request: FlightChangeOfOrderRequest, headers: FlightChangeOfOrderHeaders, runtime: Util.RuntimeOptions): FlightChangeOfOrderResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    query['order_num'] = request.orderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'FlightChangeOfOrder',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/flightchange/of-order`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 航变信息-关于订单
 *
 * @param request FlightChangeOfOrderRequest
 * @return FlightChangeOfOrderResponse
 */
async function flightChangeOfOrder(request: FlightChangeOfOrderRequest): FlightChangeOfOrderResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new FlightChangeOfOrderHeaders{};
  return flightChangeOfOrderWithOptions(request, headers, runtime);
}

model GetTokenRequest {
  appKey?: string(name='app_key', description='appKey

This parameter is required.', example='fu1bltcu3400iurywuri'),
  appSecret?: string(name='app_secret', description='appSecret

This parameter is required.', example='ZzQ3MW1mb3E1ODAwI2ldUjYlWUdJn5YI'),
}

model GetTokenResponseBody = {
  requestId?: string(name='RequestId', description='Request RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    expireTime?: long(name='expire_time', description='Remaining valid time of the token in seconds', example='7200'),
    generateTime?: long(name='generate_time', description='Timestamp of token generation in seconds', example='1677055176'),
    token?: string(name='token', description='token', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiIyUlRjY0Ezc1puSndpYU11R1ctTkVRIiwiaWF0IjoxNjc3MTU1Njg3LCJleHAiOjE2NzcxNjI4ODcsIm5iZiI6MTY3NzE1NTYyN30.bd8qBedJ7R24NC8VpMtM4Ni5OR-Cc0utPiKSx8fjoj9taalt7zXBF8uIVTETw1N-Fx9reLflwVXrbDHky7ZKqlE5o_B5Bkx-crQKlJL-NzasEmNnuJNb5kmmbCy3mvIrQfo5Q5Y0ZaQ110pXK4qd1shRbklvuQXn8lPueJtNqo8VdIOAPGG_rPwOw2P767I0fyFHcome8FR4ST1UrwxeApNKMB_BkpCsUZLgpm9h9trhKbB-3qtk6UK1GKmfw6qlWpL3PQN7FAObNruS0r0CGh3Muc9PaGsuu8Xu5on21h9WmI7L0-jatZkS55p4PEerU56XpkwJfa35_hltKNTauu'),
  }(name='data', description='Correctly processed return data'),
  errorCode?: string(name='error_code', description='Business error code', example='null'),
  errorData?: any(name='error_data', description='Data carried during error handling', example='null'),
  errorMsg?: string(name='error_msg', description='Error message', example='null'),
  status?: int32(name='status', description='When the HTTP request is successful, the status value is 200.', example='200'),
  success?: boolean(name='success', description='Whether it is correct', example='true'),
}

model GetTokenResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTokenResponseBody(name='body'),
}

/**
 * @summary Get Token
 *
 * @param request GetTokenRequest
 * @param headers map
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTokenResponse
 */
async function getTokenWithOptions(request: GetTokenRequest, headers: map[string]string, runtime: Util.RuntimeOptions): GetTokenResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.appKey)) {
    query['app_key'] = request.appKey;
  }
  if (!Util.isUnset(request.appSecret)) {
    query['app_secret'] = request.appSecret;
  }

  var req = new OpenApi.OpenApiRequest{ 
    headers = headers,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetToken',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/token`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Get Token
 *
 * @param request GetTokenRequest
 * @return GetTokenResponse
 */
async function getToken(request: GetTokenRequest): GetTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers : map[string]string = {};
  return getTokenWithOptions(request, headers, runtime);
}

model LuggageDirectHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model LuggageDirectRequest {
  flightSegmentParamList?: [ 
    {
      arrivalAirport?: string(name='arrival_airport', description='This parameter is required.', example='SIN'),
      arrivalTerminal?: string(name='arrival_terminal', example='T1'),
      arrivalTime?: long(name='arrival_time', description='This parameter is required.', example='1705285430445'),
      codeShare?: boolean(name='code_share', description='This parameter is required.', example='true'),
      departureAirport?: string(name='departure_airport', description='This parameter is required.', example='HGH'),
      departureTerminal?: string(name='departure_terminal', example='T1'),
      departureTime?: long(name='departure_time', description='This parameter is required.', example='1705285430445'),
      marketingAirline?: string(name='marketing_airline', description='This parameter is required.', example='CZ'),
      marketingFlightNo?: string(name='marketing_flight_no', description='This parameter is required.', example='CZ616'),
      operatingAirline?: string(name='operating_airline', example='CZ'),
      stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
      ticketingAirline?: string(name='ticketing_airline', example='CZ'),
    }
  ](name='flight_segment_param_list'),
}

model LuggageDirectShrinkRequest {
  flightSegmentParamListShrink?: string(name='flight_segment_param_list'),
}

model LuggageDirectResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: [ 
    {
      cityCode?: string(name='city_code', example='BJS'),
      directType?: int32(name='direct_type', example='1'),
    }
  ](name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model LuggageDirectResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LuggageDirectResponseBody(name='body'),
}

/**
 * @summary 航程行李直挂
 *
 * @param tmpReq LuggageDirectRequest
 * @param headers LuggageDirectHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return LuggageDirectResponse
 */
async function luggageDirectWithOptions(tmpReq: LuggageDirectRequest, headers: LuggageDirectHeaders, runtime: Util.RuntimeOptions): LuggageDirectResponse {
  Util.validateModel(tmpReq);
  var request = new LuggageDirectShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.flightSegmentParamList)) {
    request.flightSegmentParamListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.flightSegmentParamList, 'flight_segment_param_list', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.flightSegmentParamListShrink)) {
    query['flight_segment_param_list'] = request.flightSegmentParamListShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LuggageDirect',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/flight-data/luggage-direct`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 航程行李直挂
 *
 * @param request LuggageDirectRequest
 * @return LuggageDirectResponse
 */
async function luggageDirect(request: LuggageDirectRequest): LuggageDirectResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new LuggageDirectHeaders{};
  return luggageDirectWithOptions(request, headers, runtime);
}

model OrderDetailHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model OrderDetailRequest {
  orderNum?: long(name='order_num', description='order number created by book', example='4966***617111'),
  outOrderNum?: string(name='out_order_num', description='external order number(customized by buyer when book)', example='x091-2023-0220-j-0001'),
}

model OrderDetailResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    ancillaryItemDetailList?: [ 
      {
        ancillary?: {
          ancillaryId?: string(name='ancillary_id', description='ancillay_id', example='MDY2NTAxLCJleHAiOjE2NxNzM3MDEsIm5ix'),
          ancillaryType?: int32(name='ancillary_type', description='ancillary product type currently supports 4: paid luggage', example='4'),
          baggageAncillary?: {
            baggageAmount?: int32(name='baggage_amount', example='0'),
            baggageWeight?: int32(name='baggage_weight', example='0'),
            baggageWeightUnit?: string(name='baggage_weight_unit', example='KG'),
            isAllWeight?: boolean(name='is_all_weight'),
            price?: double(name='price', example='10.0'),
          }(name='baggage_ancillary'),
        }(name='ancillary', description='the ancillary buyer booked'),
        passenger?: {
          birthday?: string(name='birthday', description='date of birth (yyyyMMdd)', example='20020301'),
          credential?: {
            certIssuePlace?: string(name='cert_issue_place', description='place of issue, two-letter code', example='CN'),
            credentialNum?: string(name='credential_num', description='travel document number', example='E1***5674'),
            credentialType?: int32(name='credential_type', description='travel document type , only support "1"(1 means passport) currently.', example='1'),
            expireDate?: string(name='expire_date', description='expiration date', example='20290101'),
          }(name='credential', description='travel document'),
          firstName?: string(name='first_name', description='first name', example='SAN'),
          gender?: int32(name='gender', description='gender 0: male; 1: female', example='0'),
          lastName?: string(name='last_name', description='last name', example='ZHANG'),
          mobileCountryCode?: string(name='mobile_country_code', description='country code for mobile phone number', example='86'),
          mobilePhoneNumber?: string(name='mobile_phone_number', description='mobile phone number', example='183******96'),
          nationality?: string(name='nationality', description='nationality', example='CN'),
          type?: int32(name='type', description='passenger type 0: adult; 1: child; 8: infant', example='0'),
        }(name='passenger', description='passenger'),
        segmentIdList?: [ string ](name='segment_id_list', description='segment ID list, these segments share the same ancillary'),
      }
    ](name='ancillary_item_detail_list', description='ancillary product fulfillment details'),
    baggageAllowanceMap?: map[string]DataBaggageAllowanceMapValue(name='baggage_allowance_map', description='baggage rule mapping, key is passenger type, value is baggage allowance details'),
    bookTime?: long(name='book_time', description='book time(timestamp)', example='1677210784000'),
    flightItemDetailList?: [ 
      {
        bPnrList?: [ string ](name='b_pnr_list', description='b PNR(airline booking code) list'),
        cPnrList?: [ string ](name='c_pnr_list', description='c PNR(airline booking code) list'),
        flightPrice?: {
          sellPrice?: double(name='sell_price', description='selling price', example='300'),
          tax?: double(name='tax', description='tax', example='10'),
        }(name='flight_price', description='flight price information for current passenger'),
        flightSegmentCabinRelation?: [ 
          {
            cabin?: string(name='cabin', description='RBD', example='V'),
            cabinClass?: string(name='cabin_class', description='cabin class', example='Y'),
            cabinClassName?: string(name='cabin_class_name', description='cabin class description', example='economy class'),
            cabinQuantity?: string(name='cabin_quantity', description='availability', example='A'),
            segmentId?: string(name='segment_id', description='segment ID format: flight no.+departure airport[IATA airport code]+arrival airport[IATA airport code]+departure time(yyMMddHHmm)', example='HO1295-PVG-MFM-20230310'),
          }
        ](name='flight_segment_cabin_relation', description='RBD information in flight segment dimension'),
        passenger?: {
          birthday?: string(name='birthday', description='date of birth (yyyyMMdd)', example='20020301'),
          credential?: {
            certIssuePlace?: string(name='cert_issue_place', description='place of issue, two-letter code', example='CN'),
            credentialNum?: string(name='credential_num', description='travel document number', example='E1***5674'),
            credentialType?: int32(name='credential_type', description='travel document type , only support "1"(1 means passport) currently.', example='1'),
            expireDate?: string(name='expire_date', description='expiration date', example='20290101'),
          }(name='credential', description='travel document'),
          firstName?: string(name='first_name', description='first name', example='SAN'),
          gender?: int32(name='gender', description='gender 0: MALE; 1: FEMALE', example='0'),
          lastName?: string(name='last_name', description='last name', example='ZHANG'),
          mobileCountryCode?: string(name='mobile_country_code', description='mobile country code', example='86'),
          mobilePhoneNumber?: string(name='mobile_phone_number', description='mobile phone number', example='183******96'),
          nationality?: string(name='nationality', description='nationality (two-letter code)', example='CN'),
          type?: int32(name='type', description='passenger type 0: adult; 1: child; 8: infant', example='0'),
        }(name='passenger', description='passenger'),
        ticketAirLine?: string(name='ticket_air_line', description='ticketing airline', example='HO'),
        ticketNos?: [ string ](name='ticket_nos', description='ticket number list'),
      }
    ](name='flight_item_detail_list', description='flight product fulfillment details'),
    orderNum?: long(name='order_num', description='order number created by book', example='4966***617111'),
    orderStatus?: int32(name='order_status', description='order status 

1: order creation in process; 

2: order creation successful; 

3: order paid; 

4: order successful; 

5: order closed', example='4'),
    outOrderNum?: string(name='out_order_num', description='external order number(customized by buyer when book)', example='x091-2023-0220-j-0001'),
    passengerList?: [ 
      {
        birthday?: string(name='birthday', description='date of birth (yyyyMMdd)', example='20020301'),
        credential?: {
          certIssuePlace?: string(name='cert_issue_place', description='place of issue, two-letter code', example='CN'),
          credentialNum?: string(name='credential_num', description='travel document number', example='E1***5674'),
          credentialType?: int32(name='credential_type', description='travel document type , only support "1"(1 means passport) currently.', example='1'),
          expireDate?: string(name='expire_date', description='expiration date', example='20290101'),
        }(name='credential', description='travel document'),
        firstName?: string(name='first_name', description='first name', example='SAN'),
        gender?: int32(name='gender', description='gender 0: MALE; 1: FEMALE', example='0'),
        lastName?: string(name='last_name', description='last name', example='ZHANG'),
        mobileCountryCode?: string(name='mobile_country_code', description='mobile country code', example='86'),
        mobilePhoneNumber?: string(name='mobile_phone_number', description='mobile phone number', example='183******96'),
        nationality?: string(name='nationality', description='nationality (two-letter code)', example='CN'),
        type?: int32(name='type', description='passenger type 0: adult; 1: child; 8: infant', example='0'),
      }
    ](name='passenger_list', description='the information about all passenger of current order'),
    payStatus?: int32(name='pay_status', description='payment status 

1: payment in process; 

2: deduction successful; 

3: paid to the seller; 

4: transaction closed', example='2'),
    payTime?: long(name='pay_time', description='pay time(timestamp)', example='1677210788000'),
    promotionPrice?: double(name='promotion_price', description='discount amount', example='10'),
    realPayPrice?: double(name='real_pay_price', description='actual payment amount', example='3000'),
    refundChangeRuleMap?: map[string]DataRefundChangeRuleMapValue(name='refund_change_rule_map', description='change and refund policy mapping, key is passenger type, value is change and refund policy details'),
    sessionNick?: string(name='session_nick', description='buyer nickname', example='nick'),
    solution?: {
      adultPrice?: double(name='adult_price', description='adult fare', example='300'),
      adultTax?: double(name='adult_tax', description='adult tax', example='30'),
      childPrice?: double(name='child_price', description='child fare', example='200'),
      childTax?: double(name='child_tax', description='child tax', example='20'),
      infantPrice?: double(name='infant_price', description='infant fare', example='100'),
      infantTax?: double(name='infant_tax', description='infant tax', example='10'),
      journeyList?: [ 
        {
          segmentList?: [ 
            {
              arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)', example='MFM'),
              arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)', example='MFM'),
              arrivalTerminal?: string(name='arrival_terminal', description='arrival terminal', example='T1'),
              arrivalTime?: string(name='arrival_time', description='arrival time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 10:40:00'),
              availability?: string(name='availability', description='availability', example='7'),
              cabin?: string(name='cabin', description='RBD', example='V'),
              cabinClass?: string(name='cabin_class', description='cabin class', example='Y'),
              codeShare?: boolean(name='code_share', description='code share or not', example='false'),
              departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)', example='PVG'),
              departureCity?: string(name='departure_city', description='departure city code (capitalized)', example='SHA'),
              departureTerminal?: string(name='departure_terminal', description='departure terminal', example='T2'),
              departureTime?: string(name='departure_time', description='departure time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 07:55:00'),
              equipType?: string(name='equip_type', description='equipment type', example='32Q'),
              flightDuration?: int32(name='flight_duration', description='flight time, unit: minute', example='165'),
              marketingAirline?: string(name='marketing_airline', description='marketing airline code (eg: KA)', example='HO'),
              marketingFlightNo?: string(name='marketing_flight_no', description='marketing airline flight no. (eg: KA5809)', example='HO1295'),
              marketingFlightNoInt?: int32(name='marketing_flight_no_int', description='marketing airline flight no. (eg: 5809)', example='1295'),
              operatingAirline?: string(name='operating_airline', description='operating airline code (eg: CX)', example='HO'),
              operatingFlightNo?: string(name='operating_flight_no', description='operating airline flight no. (eg: CX601)', example='HO1295'),
              segmentId?: string(name='segment_id', description='segment ID format: flight no.+departure airport[IATA airport code]+arrival airport[IATA airport code]+departure time(MMdd)', example='HO1295-PVG-MFM-20230310'),
              stopCityList?: string(name='stop_city_list', description='stop city list when stop_quantity > 1 , use “,” for seperation', example='SEL,HKG'),
              stopQuantity?: int32(name='stop_quantity', description='number of stops', example='0'),
            }
          ](name='segment_list', description='segment list'),
          transferCount?: int32(name='transfer_count', description='number of transfers', example='0'),
        }
      ](name='journey_list', description='journey list'),
      productTypeDescription?: string(name='product_type_description', description='product type description', example='description'),
      refundTicketCouponDescription?: string(name='refund_ticket_coupon_description', description='refund coupon description', example='description'),
      segmentBaggageCheckInInfoList?: [ 
        {
          luggageDirectInfoType?: int32(name='luggage_direct_info_type', description='through check-in baggage policy type

1. baggage through check-in between segments
2. baggage re-check-in needed between segments
3. baggage through check-in at stop city ( applies for stop flight )
4. baggage re-checkin needed at stop city ( applies for stop flight )', example='1'),
          segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same baggage through check-in policy'),
        }
      ](name='segment_baggage_check_in_info_list', description='through check-in baggage policy'),
      segmentBaggageMappingList?: [ 
        {
          passengerBaggageAllowanceMapping?: map[string]DataSolutionSegmentBaggageMappingListPassengerBaggageAllowanceMappingValue(name='passenger_baggage_allowance_mapping', description='baggage rule mapping, key is passenger type, value is baggage allowance details'),
          segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same baggage rule'),
        }
      ](name='segment_baggage_mapping_list', description='baggage rule list'),
      segmentRefundChangeRuleMappingList?: [ 
        {
          refundChangeRuleMap?: map[string]DataSolutionSegmentRefundChangeRuleMappingListRefundChangeRuleMapValue(name='refund_change_rule_map', description='change and refund policy mapping, key is passenger type, value is change and refund policy details'),
          segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same change and refund policy'),
        }
      ](name='segment_refund_change_rule_mapping_list', description='change and refund policy'),
      solutionId?: string(name='solution_id', description='solution_id', example='eJwz8DeySEo0NjQ01TU3TUxxx'),
    }(name='solution', description='the solution buyer booked'),
    succeedTime?: long(name='succeed_time', description='order success time(timestamp)', example='1677210786000'),
    totalPrice?: double(name='total_price', description='total price of current order', example='3000'),
    transactionNo?: string(name='transaction_no', description='transaction number', example='hkduendkd-2023-dj0'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model OrderDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OrderDetailResponseBody(name='body'),
}

/**
 * @summary Trade-Order Details
 *
 * @description query order detail
 *
 * @param request OrderDetailRequest
 * @param headers OrderDetailHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return OrderDetailResponse
 */
async function orderDetailWithOptions(request: OrderDetailRequest, headers: OrderDetailHeaders, runtime: Util.RuntimeOptions): OrderDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    query['order_num'] = request.orderNum;
  }
  if (!Util.isUnset(request.outOrderNum)) {
    query['out_order_num'] = request.outOrderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OrderDetail',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/order-detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Trade-Order Details
 *
 * @description query order detail
 *
 * @param request OrderDetailRequest
 * @return OrderDetailResponse
 */
async function orderDetail(request: OrderDetailRequest): OrderDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new OrderDetailHeaders{};
  return orderDetailWithOptions(request, headers, runtime);
}

model OrderListHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model OrderListRequest {
  bookTimeEnd?: long(name='book_time_end', description='latest booking time (timestamp)

This parameter is required.', example='2023-02-02 11:20:00'),
  bookTimeStart?: long(name='book_time_start', description='earliest book time(timestamp)

This parameter is required.', example='2023-02-01 11:20:00'),
  pageIndex?: int32(name='page_index', description='pagination query parameters, from which page to start querying', example='1'),
  pageSize?: int32(name='page_size', description='pagination query parameters, how many orders to return', example='20'),
  status?: int32(name='status', description='which order status will be query

1: order reservation in process

2: order reservation successful

3: order paid

4: order successful

5: order closed', example='4'),
}

model OrderListResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    list?: [ 
      {
        bookTime?: long(name='book_time', description='book time(timestamp)', example='1677210784000'),
        orderNum?: long(name='order_num', description='order number created by book', example='4966***617111'),
        orderStatus?: string(name='order_status', description='order status

1: order reservation in process

2: order reservation successful

3: order paid

4: order successful

5: order closed', example='4'),
        outOrderNum?: string(name='out_order_num', description='external order number(customized by buyer when book)', example='x091-2023-0220-j-0001'),
        passengerList?: [ 
          {
            birthday?: string(name='birthday', description='date of birth (yyyyMMdd)', example='20020301'),
            credential?: {
              certIssuePlace?: string(name='cert_issue_place', description='issuing place (two-letter code)', example='CN'),
              credentialNum?: string(name='credential_num', description='credential number', example='E1***5674'),
              credentialType?: int32(name='credential_type', description='credential type , only support "1"(1 means passport) currently.', example='1'),
              expireDate?: string(name='expire_date', description='credential expiration date', example='20290101'),
            }(name='credential', description='credential'),
            firstName?: string(name='first_name', description='first name', example='SAN'),
            gender?: int32(name='gender', description='gender 0: MALE; 1: FEMALE', example='0'),
            lastName?: string(name='last_name', description='last name', example='ZHANG'),
            mobileCountryCode?: string(name='mobile_country_code', description='mobile country code', example='86'),
            mobilePhoneNumber?: string(name='mobile_phone_number', description='mobile phone number', example='183******96'),
            nationality?: string(name='nationality', description='nationality (two-letter code)', example='CN'),
            type?: int32(name='type', description='passenger type 0: adult; 1: child; 8: infant', example='0'),
          }
        ](name='passenger_list', description='the information about all passenger of current order'),
        payStatus?: string(name='pay_status', description='payment status

1: payment in process

2: deduction successful

3: paid to the seller

4: transaction closed', example='2'),
        payTime?: long(name='pay_time', description='pay time(timestamp)', example='1677210788000'),
        promotionPrice?: double(name='promotion_price', description='discount amount', example='10'),
        realPayPrice?: double(name='real_pay_price', description='actual payment amount', example='3000'),
        sessionNick?: string(name='session_nick', description='buyer nickname', example='nick'),
        succeedTime?: long(name='succeed_time', description='order success time(timestamp)', example='1677210786000'),
        totalPrice?: double(name='total_price', description='total price of current order', example='3000'),
        transactionNo?: string(name='transaction_no', description='transaction number', example='hkduendkd-2023-dj0'),
      }
    ](name='list', description='order list'),
    pagination?: {
      currentPage?: int32(name='current_page', description='current page index', example='1'),
      pageSize?: int32(name='page_size', description='page size', example='10'),
      totalCount?: int32(name='total_count', description='the number of total orders', example='5'),
      totalPage?: int32(name='total_page', description='the number of total pages', example='1'),
    }(name='pagination', description='information of pagination'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model OrderListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OrderListResponseBody(name='body'),
}

/**
 * @summary Trade - Order List
 *
 * @description query order list
 *
 * @param request OrderListRequest
 * @param headers OrderListHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return OrderListResponse
 */
async function orderListWithOptions(request: OrderListRequest, headers: OrderListHeaders, runtime: Util.RuntimeOptions): OrderListResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.bookTimeEnd)) {
    query['book_time_end'] = request.bookTimeEnd;
  }
  if (!Util.isUnset(request.bookTimeStart)) {
    query['book_time_start'] = request.bookTimeStart;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['page_index'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['status'] = request.status;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OrderList',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/order-list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Trade - Order List
 *
 * @description query order list
 *
 * @param request OrderListRequest
 * @return OrderListResponse
 */
async function orderList(request: OrderListRequest): OrderListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new OrderListHeaders{};
  return orderListWithOptions(request, headers, runtime);
}

model PricingHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model PricingRequest {
  solutionId?: string(name='solution_id', description='solution_id returned by Enrich

This parameter is required.', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
}

model PricingResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    changedPriceInfo?: {
      adultPrice?: double(name='adult_price', description='adult fare', example='100'),
      adultTax?: double(name='adult_tax', description='adult tax', example='10'),
      childPrice?: double(name='child_price', description='child fare', example='100'),
      childTax?: double(name='child_tax', description='child tax', example='10'),
      infantPrice?: double(name='infant_price', description='infant fare', example='100'),
      infantTax?: double(name='infant_tax', description='infant tax', example='10'),
    }(name='changed_price_info', description='price information after the price change'),
    isChanged?: boolean(name='is_changed', description='whether the price has changed', example='true'),
    originalPriceInfo?: {
      adultPrice?: double(name='adult_price', description='adult fare', example='200'),
      adultTax?: double(name='adult_tax', description='adult tax', example='20'),
      childPrice?: double(name='child_price', description='child fare', example='200'),
      childTax?: double(name='child_tax', description='child tax', example='20'),
      infantPrice?: double(name='infant_price', description='infant fare', example='200'),
      infantTax?: double(name='infant_tax', description='infant tax', example='20'),
    }(name='original_price_info', description='the price information before the change, only available when is_changed = true'),
    remainSeats?: string(name='remain_seats', description='remaining seats: A indicates more than 9, 0-9 represents the specific number', example='A'),
    solution?: {
      adultPrice?: double(name='adult_price', description='adult fare', example='300'),
      adultTax?: double(name='adult_tax', description='adult tax', example='30'),
      childPrice?: double(name='child_price', description='child fare', example='200'),
      childTax?: double(name='child_tax', description='child tax', example='20'),
      infantPrice?: double(name='infant_price', description='infant fare', example='200'),
      infantTax?: double(name='infant_tax', description='infant tax', example='10'),
      journeyList?: [ 
        {
          segmentList?: [ 
            {
              arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)', example='MFM'),
              arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)', example='MFM'),
              arrivalTerminal?: string(name='arrival_terminal', description='arrival terminal', example='T1'),
              arrivalTime?: string(name='arrival_time', description='arrival time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 10:40:00'),
              availability?: string(name='availability', description='available seats (for reference only)', example='7'),
              cabin?: string(name='cabin', description='RBD', example='V'),
              cabinClass?: string(name='cabin_class', description='cabin class', example='ALL_CABIN'),
              codeShare?: boolean(name='code_share', description='code share or not', example='false'),
              departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)', example='PVG'),
              departureCity?: string(name='departure_city', description='departure city code (capitalized)', example='SHA'),
              departureTerminal?: string(name='departure_terminal', description='departure terminal', example='T2'),
              departureTime?: string(name='departure_time', description='departure time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 07:55:00'),
              equipType?: string(name='equip_type', description='equipment type', example='32Q'),
              flightDuration?: int32(name='flight_duration', description='flight time, unit: minute', example='165'),
              marketingAirline?: string(name='marketing_airline', description='marketing airline code (eg: KA)', example='HO'),
              marketingFlightNo?: string(name='marketing_flight_no', description='marketing airline flight no. (eg: KA5809)', example='HO1295'),
              marketingFlightNoInt?: int32(name='marketing_flight_no_int', description='marketing airline flight no. (eg: 5809)', example='1295'),
              operatingAirline?: string(name='operating_airline', description='operating airline code (eg: CX)', example='HO'),
              operatingFlightNo?: string(name='operating_flight_no', description='operating airline flight no. (eg: CX601)', example='HO1295'),
              segmentId?: string(name='segment_id', description='segment ID format: flight no.+departure airport[IATA airport code]+arrival airport[IATA airport code]+departure time(MMdd)', example='HO1295-PVG-MFM-20230310'),
              stopCityList?: string(name='stop_city_list', description='stop city list. when stop_quantity > 1 , use “,” for seperation', example='MFM,PVG'),
              stopQuantity?: int32(name='stop_quantity', description='number of stops', example='0'),
            }
          ](name='segment_list', description='segment list'),
          transferCount?: int32(name='transfer_count', description='number of transfers', example='0'),
        }
      ](name='journey_list', description='journey list'),
      productTypeDescription?: string(name='product_type_description', description='product type description', example='description'),
      refundTicketCouponDescription?: string(name='refund_ticket_coupon_description', description='refund coupon description', example='description'),
      segmentBaggageCheckInInfoList?: [ 
        {
          luggageDirectInfoType?: int32(name='luggage_direct_info_type', description='through check-in baggage policy type

1. baggage through check-in between segments
2. baggage re-check-in needed between segments
3. baggage through check-in at stop city ( applies for stop flight )
4. baggage re-checkin needed at stop city ( applies for stop flight )', example='1'),
          segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same baggage through check-in policy'),
        }
      ](name='segment_baggage_check_in_info_list', description='through check-in baggage policy'),
      segmentBaggageMappingList?: [ 
        {
          passengerBaggageAllowanceMapping?: map[string]DataSolutionSegmentBaggageMappingListPassengerBaggageAllowanceMappingValue(name='passenger_baggage_allowance_mapping', description='baggage rule mapping, key is passenger type, value is baggage allowance details'),
          segmentIdList?: [ string ](name='segment_id_list', description='segment id list all the listed segment id share the same baggage rule'),
        }
      ](name='segment_baggage_mapping_list', description='baggage rule list'),
      segmentRefundChangeRuleMappingList?: [ 
        {
          refundChangeRuleMap?: map[string]DataSolutionSegmentRefundChangeRuleMappingListRefundChangeRuleMapValue(name='refund_change_rule_map', description='change and refund policy mapping, key is passenger type, value is change and refund policy detail'),
          segmentIdList?: [ string ](name='segment_id_list', description='segment id list. all the listed segment ids share the same change and refund policy'),
        }
      ](name='segment_refund_change_rule_mapping_list', description='change and refund policy'),
      solutionId?: string(name='solution_id', description='solution_id, equals to solution_id in request', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
    }(name='solution', description='the solution represented by the solution_id in request'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model PricingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: PricingResponseBody(name='body'),
}

/**
 * @summary Trade - Seat and Price Verification
 *
 * @description Check is price and remaining seats of solution you selected has changed. You should enter the solution_id returned by enrich.
 *
 * @param request PricingRequest
 * @param headers PricingHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return PricingResponse
 */
async function pricingWithOptions(request: PricingRequest, headers: PricingHeaders, runtime: Util.RuntimeOptions): PricingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.solutionId)) {
    body['solution_id'] = request.solutionId;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Pricing',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-pricing`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Trade - Seat and Price Verification
 *
 * @description Check is price and remaining seats of solution you selected has changed. You should enter the solution_id returned by enrich.
 *
 * @param request PricingRequest
 * @return PricingResponse
 */
async function pricing(request: PricingRequest): PricingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new PricingHeaders{};
  return pricingWithOptions(request, headers, runtime);
}

model RefundApplyHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model RefundApplyRequest {
  orderNum?: long(name='order_num', description='order number

This parameter is required.', example='4966***617111'),
  refundJourneys?: [ 
    {
      segmentList?: [ 
        {
          arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)

This parameter is required.', example='MFM'),
          arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)

This parameter is required.', example='MFM'),
          departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)

This parameter is required.', example='PVG'),
          departureCity?: string(name='departure_city', description='departure city code (capitalized)

This parameter is required.', example='SHA'),
        }
      ](name='segment_list', description='segment list

This parameter is required.'),
    }
  ](name='refund_journeys', description='journeys for which a refund is being requested

This parameter is required.'),
  refundPassengerList?: [ 
    {
      document?: string(name='document', description='credential number', example='411***********4411'),
      firstName?: string(name='first_name', description='first name

This parameter is required.', example='SAN'),
      lastName?: string(name='last_name', description='last name

This parameter is required.', example='ZHANG'),
    }
  ](name='refund_passenger_list', description='passengers that applying for a refund

This parameter is required.'),
  refundType?: {
    file?: [ string ](name='file', description='attachment file URLs

(note: upload the files using a separate file upload interface to get the file URLs)', example='[xxx,yyy]'),
    refundTypeId?: int32(name='refund_type_id', description='refund type 

2: voluntary (I want to change my travel plan/I don\\\\"t want to fly) 

5: involuntary, due to flight delay or cancellation, schedule changes, etc., by the airline 

6: involuntary, due to health reasons with a certificate from a hospital of at least secondary level A or above 

 (note: attachments are not mandatory, but it is recommended to provide them for involuntary refunds as they can increase the success rate)

This parameter is required.', example='2'),
    remark?: string(name='remark', description='remark', example='remark desc'),
  }(name='refund_type', description='refund type and attachments

This parameter is required.'),
}

model RefundApplyShrinkRequest {
  orderNum?: long(name='order_num', description='order number

This parameter is required.', example='4966***617111'),
  refundJourneysShrink?: string(name='refund_journeys', description='journeys for which a refund is being requested

This parameter is required.'),
  refundPassengerListShrink?: string(name='refund_passenger_list', description='passengers that applying for a refund

This parameter is required.'),
  refundTypeShrink?: string(name='refund_type', description='refund type and attachments

This parameter is required.'),
}

model RefundApplyResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    orderNum?: long(name='order_num', description='order number', example='4966***617111'),
    refundResults?: [ 
      {
        failReason?: string(name='fail_reason', description='reason for refund application failure', example='desc reason'),
        refundOrderNum?: long(name='refund_order_num', description='refund order number', example='4966***617202'),
        refundPassengers?: [ 
          {
            document?: string(name='document', description='credential number', example='411***********4411'),
            firstName?: string(name='first_name', description='first name', example='SAN'),
            lastName?: string(name='last_name', description='last name', example='ZHANG'),
          }
        ](name='refund_passengers', description='passengers of current refund order'),
        status?: int32(name='status', description='refund order status 

0: refund order created successfully

1: refund order creation failed', example='0'),
      }
    ](name='refund_results', description='refund results'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model RefundApplyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefundApplyResponseBody(name='body'),
}

/**
 * @summary 退票-申请
 *
 * @description Apply for a refund and generate a refund order.
 *
 * @param tmpReq RefundApplyRequest
 * @param headers RefundApplyHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefundApplyResponse
 */
async function refundApplyWithOptions(tmpReq: RefundApplyRequest, headers: RefundApplyHeaders, runtime: Util.RuntimeOptions): RefundApplyResponse {
  Util.validateModel(tmpReq);
  var request = new RefundApplyShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.refundJourneys)) {
    request.refundJourneysShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.refundJourneys, 'refund_journeys', 'json');
  }
  if (!Util.isUnset(tmpReq.refundPassengerList)) {
    request.refundPassengerListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.refundPassengerList, 'refund_passenger_list', 'json');
  }
  if (!Util.isUnset(tmpReq.refundType)) {
    request.refundTypeShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.refundType, 'refund_type', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    body['order_num'] = request.orderNum;
  }
  if (!Util.isUnset(request.refundJourneysShrink)) {
    body['refund_journeys'] = request.refundJourneysShrink;
  }
  if (!Util.isUnset(request.refundPassengerListShrink)) {
    body['refund_passenger_list'] = request.refundPassengerListShrink;
  }
  if (!Util.isUnset(request.refundTypeShrink)) {
    body['refund_type'] = request.refundTypeShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RefundApply',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/refund/action-apply`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 退票-申请
 *
 * @description Apply for a refund and generate a refund order.
 *
 * @param request RefundApplyRequest
 * @return RefundApplyResponse
 */
async function refundApply(request: RefundApplyRequest): RefundApplyResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new RefundApplyHeaders{};
  return refundApplyWithOptions(request, headers, runtime);
}

model RefundDetailHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model RefundDetailRequest {
  refundOrderNum?: long(name='refund_order_num', description='refund order number

This parameter is required.', example='4966***617732'),
}

model RefundDetailResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    containMultiRefund?: boolean(name='contain_multi_refund', description='whether it is a supplementary refund order (if the refund amount is not enough, you can use RefundApply to create a supplementary refund order)', example='false'),
    multiRefundDetails?: [ 
      {
        multiRefundOrderNum?: long(name='multi_refund_order_num', description='supplementary refund order number', example='498843***6950'),
        multiRefundTransactionNo?: string(name='multi_refund_transaction_no', description='transaction number of the supplementary refund order', example='498843***6950'),
        passengerMultiRefundDetails?: [ 
          {
            changeOrderRefundFee?: double(name='change_order_refund_fee', description='amount of the supplementary refund for the change order', example='30'),
            originalOrderRefundFee?: double(name='original_order_refund_fee', description='amount of the supplementary refund for the original order', example='30'),
            passenger?: {
              document?: string(name='document', description='credential number', example='411***********4411'),
              firstName?: string(name='first_name', description='first name', example='SAN'),
              lastName?: string(name='last_name', description='last name', example='ZHANG'),
            }(name='passenger', description='passenger for the refund'),
          }
        ](name='passenger_multi_refund_details', description='supplementary refund details in passenger dimension'),
      }
    ](name='multi_refund_details', description='supplementary refund orders'),
    orderNum?: long(name='order_num', description='order number that returned by Book', example='4966***617111'),
    passengerRefundDetails?: [ 
      {
        passenger?: {
          document?: string(name='document', description='credential number', example='411***********4411'),
          firstName?: string(name='first_name', description='first name', example='SAN'),
          lastName?: string(name='last_name', description='first name', example='ZHANG'),
        }(name='passenger', description='information of the passenger applying for a refund'),
        refundFee?: {
          alreadyUsedTotalFee?: double(name='already_used_total_fee', description='total price of the used flight tickets', example='30'),
          modifyRefundToBuyerMoney?: double(name='modify_refund_to_buyer_money', description='amount refunded to the user after change (only available when has change order)', example='30'),
          nonRefundableChangeServiceFee?: double(name='non_refundable_change_service_fee', description='non-refundable change service fee', example='30'),
          nonRefundableChangeUpgradeFee?: double(name='non_refundable_change_upgrade_fee', description='non-refundable upgrade fee', example='30'),
          nonRefundableTaxFee?: double(name='non_refundable_tax_fee', description='non-refundable tax amount, i.e., tax refund fee', example='30'),
          nonRefundableTicketFee?: double(name='non_refundable_ticket_fee', description='non-refundable ticket amount, i.e., ticket refund fee', example='30'),
          refundToBuyerMoney?: double(name='refund_to_buyer_money', description='amount refundable to the user from the original ticket (fare + tax - non_refundable_ticket_fee - non_refundable_tax_fee - already_used_total_fee - discount)', example='30'),
        }(name='refund_fee', description='details of the refund fee'),
      }
    ](name='passenger_refund_details', description='refund details by passenger dimension'),
    paySuccessUtcTime?: long(name='pay_success_utc_time', description='refund completed time(timestamp)', example='1677229005000'),
    refundAttachmentUrls?: [ string ](name='refund_attachment_urls', description='URLs for refund attachments', example='[zzz,yyy]'),
    refundJourneys?: [ 
      {
        segmentList?: [ 
          {
            arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)', example='MFM'),
            arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)', example='MFM'),
            arrivalTerminal?: string(name='arrival_terminal', description='arrival terminal', example='T1'),
            arrivalTime?: string(name='arrival_time', description='arrival time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 10:40:00'),
            availability?: string(name='availability', description='field deprecated', example='7'),
            cabin?: string(name='cabin', description='RBD', example='V'),
            cabinClass?: string(name='cabin_class', description='cabin class', example='Y'),
            codeShare?: boolean(name='code_share', description='code share or not', example='false'),
            departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)', example='PVG'),
            departureCity?: string(name='departure_city', description='departure city code (capitalized)', example='SHA'),
            departureTerminal?: string(name='departure_terminal', description='departure terminal', example='T2'),
            departureTime?: string(name='departure_time', description='departure time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 07:55:00'),
            equipType?: string(name='equip_type', description='equipment type', example='32Q'),
            flightDuration?: int32(name='flight_duration', description='flight time, unit: minute', example='165'),
            marketingAirline?: string(name='marketing_airline', description='marketing airline code (eg: KA)', example='HO'),
            marketingFlightNo?: string(name='marketing_flight_no', description='marketing flight no. (eg: KA5809)', example='HO1295'),
            marketingFlightNoInt?: int32(name='marketing_flight_no_int', description='marketing flight no. (eg: 5809)', example='1295'),
            operatingAirline?: string(name='operating_airline', description='operating airline code (eg: CX)', example='HO'),
            operatingFlightNo?: string(name='operating_flight_no', description='operating flight no. (eg: CX601)', example='HO1295'),
            segmentId?: string(name='segment_id', description='segment ID format: flight no.+departure airport[IATA airport code]+arrival airport[IATA airport code]+departure time(MMdd)', example='HO1295-PVG-MFM-20230310'),
            stopCityList?: string(name='stop_city_list', description='stopover city list when stop_quantity > 0 , use “,” for seperation use', example='SEL,HKG'),
            stopQuantity?: int32(name='stop_quantity', description='number of stopover', example='0'),
          }
        ](name='segment_list', description='segment list'),
        transferCount?: int32(name='transfer_count', description='number of transfer', example='0'),
      }
    ](name='refund_journeys', description='refunded journey'),
    refundOrderNum?: long(name='refund_order_num', description='refund order number that returned by RefundApply', example='4966***617654'),
    refundReason?: string(name='refund_reason', description='reason for refund', example='desc reason'),
    refundType?: int32(name='refund_type', description='refund type 

2: voluntary application

5: flight delay or cancellation, flight schedule change, etc., due to airline reasons

6: health reasons with a certificate from a secondary class A hospital or above

7: non-voluntary confirmed guidance

100: non-voluntary non-confirmed guidance', example='5'),
    refuseReason?: string(name='refuse_reason', description='reason for refund rejection', example='refuse reason'),
    status?: int32(name='status', description='refund order status

0: refund application

1: refund in progress

2: refund failed

3: refund succeeded', example='1'),
    transactionNo?: string(name='transaction_no', description='transaction number', example='1677229005000'),
    utcCreateTime?: long(name='utc_create_time', description='refund order created time(timestamp)', example='1677229002000'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model RefundDetailResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefundDetailResponseBody(name='body'),
}

/**
 * @summary Refund - Detail
 *
 * @description Query refund order detail.
 *
 * @param request RefundDetailRequest
 * @param headers RefundDetailHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefundDetailResponse
 */
async function refundDetailWithOptions(request: RefundDetailRequest, headers: RefundDetailHeaders, runtime: Util.RuntimeOptions): RefundDetailResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.refundOrderNum)) {
    query['refund_order_num'] = request.refundOrderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefundDetail',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/refund/detail`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Refund - Detail
 *
 * @description Query refund order detail.
 *
 * @param request RefundDetailRequest
 * @return RefundDetailResponse
 */
async function refundDetail(request: RefundDetailRequest): RefundDetailResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new RefundDetailHeaders{};
  return refundDetailWithOptions(request, headers, runtime);
}

model RefundDetailListHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model RefundDetailListRequest {
  orderNum?: long(name='order_num', description='order number returned by Book', example='49884*****950'),
  pageIndex?: int32(name='page_index', description='pagination query parameters, from which page to start querying', example='1'),
  pageSize?: int32(name='page_size', description='pagination query parameters, how many orders to return', example='20'),
  refundCreateBeginTime?: long(name='refund_create_begin_time', description='the earliest time(timestamp) of refund order creation

This parameter is required.', example='1677229002000'),
  refundCreateEndTime?: long(name='refund_create_end_time', description='the latest time(timestamp) of refund order creation

This parameter is required.', example='1677229005000'),
}

model RefundDetailListResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    list?: [ 
      {
        isMultiRefund?: boolean(name='is_multi_refund', description='whether it is a supplementary refund order (if the refund amount is not enough, you can use RefundApply to create a supplementary refund order)', example='true'),
        orderNum?: long(name='order_num', description='order number that returned by Book', example='49884*****2345'),
        refundOrderNum?: long(name='refund_order_num', description='refund order number that returned by RefundApply', example='49884*****950'),
        refundOrderStatus?: int32(name='refund_order_status', description='refund order status 

0: refund application

1: refund in progress

2: refund failed

3: refund succeeded', example='1'),
        relatedRefundOrderNum?: string(name='related_refund_order_num', description='the original refund order number associated with this supplementary refund order, only avaliable when is_multi_refund=true', example='49884*****2387'),
        transactionNo?: string(name='transaction_no', description='transaction number', example='49884**tde-95za'),
        utcCreateTime?: long(name='utc_create_time', description='refund time(timestamp)', example='1677229002000'),
      }
    ](name='list', description='refund order list'),
    pagination?: {
      currentPage?: int32(name='current_page', description='current page index', example='1'),
      pageSize?: int32(name='page_size', description='page size', example='10'),
      totalCount?: int32(name='total_count', description='the number of total refund orders', example='5'),
      totalPage?: int32(name='total_page', description='the number of total pages', example='1'),
    }(name='pagination', description='information of pagination'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model RefundDetailListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RefundDetailListResponseBody(name='body'),
}

/**
 * @summary Refund - Detail List
 *
 * @description Query refund order detail.
 *
 * @param request RefundDetailListRequest
 * @param headers RefundDetailListHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return RefundDetailListResponse
 */
async function refundDetailListWithOptions(request: RefundDetailListRequest, headers: RefundDetailListHeaders, runtime: Util.RuntimeOptions): RefundDetailListResponse {
  Util.validateModel(request);
  var query : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    query['order_num'] = request.orderNum;
  }
  if (!Util.isUnset(request.pageIndex)) {
    query['page_index'] = request.pageIndex;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['page_size'] = request.pageSize;
  }
  if (!Util.isUnset(request.refundCreateBeginTime)) {
    query['refund_create_begin_time'] = request.refundCreateBeginTime;
  }
  if (!Util.isUnset(request.refundCreateEndTime)) {
    query['refund_create_end_time'] = request.refundCreateEndTime;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RefundDetailList',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/refund/detail-list`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Refund - Detail List
 *
 * @description Query refund order detail.
 *
 * @param request RefundDetailListRequest
 * @return RefundDetailListResponse
 */
async function refundDetailList(request: RefundDetailListRequest): RefundDetailListResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new RefundDetailListHeaders{};
  return refundDetailListWithOptions(request, headers, runtime);
}

model SearchHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model SearchRequest {
  adults?: int32(name='adults', description='adult passenger amount 1-9', example='2'),
  airLegs?: [ 
    {
      arrivalAirportList?: [ string ](name='arrival_airport_list', description='arrival airport [IATA airport code] list', example='MFM'),
      arrivalCity?: string(name='arrival_city', description='arrival city code

This parameter is required.', example='MFM'),
      departureAirportList?: [ string ](name='departure_airport_list', description='departure airport [IATA airport code] list', example='PVG'),
      departureCity?: string(name='departure_city', description='departure city code

This parameter is required.', example='SHA'),
      departureDate?: string(name='departure_date', description='departure date (eg: yyyyMMdd)

This parameter is required.', example='20230310'),
    }
  ](name='air_legs', description='itinerary list

This parameter is required.'),
  cabinClass?: string(name='cabin_class', description='cabin class
1. **ALL_CABIN** : all cabin class
2. **Y** : economy class
3. **FC** : first class and business class
4. **S** : premium economy class
5. **YS** : economy class and premium economy class
6. **YSC** : economy class, premium economy class and business class', example='ALL_CABIN'),
  children?: int32(name='children', description='child passenger amount 0-9', example='1'),
  infants?: int32(name='infants', description='infant passenger amount 0-9', example='1'),
  searchControlOptions?: {
    airlineExcludedList?: [ string ](name='airline_excluded_list', description='excluded airlines list'),
    airlinePreferList?: [ string ](name='airline_prefer_list', description='preferred airlines list'),
    serviceQuality?: string(name='service_quality', example='A1'),
  }(name='search_control_options', description='search controls'),
}

model SearchShrinkRequest {
  adults?: int32(name='adults', description='adult passenger amount 1-9', example='2'),
  airLegsShrink?: string(name='air_legs', description='itinerary list

This parameter is required.'),
  cabinClass?: string(name='cabin_class', description='cabin class
1. **ALL_CABIN** : all cabin class
2. **Y** : economy class
3. **FC** : first class and business class
4. **S** : premium economy class
5. **YS** : economy class and premium economy class
6. **YSC** : economy class, premium economy class and business class', example='ALL_CABIN'),
  children?: int32(name='children', description='child passenger amount 0-9', example='1'),
  infants?: int32(name='infants', description='infant passenger amount 0-9', example='1'),
  searchControlOptionsShrink?: string(name='search_control_options', description='search controls'),
}

model SearchResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='2236993B-7BE7-5F92-B179-21FF08570165'),
  data?: {
    solutionList?: [ 
      {
        adultPrice?: double(name='adult_price', description='adult fare', example='600'),
        adultTax?: double(name='adult_tax', description='adult tax', example='11'),
        childPrice?: double(name='child_price', description='child fare', example='500'),
        childTax?: double(name='child_tax', description='child tax', example='10'),
        infantPrice?: double(name='infant_price', description='infant fare', example='400'),
        infantTax?: double(name='infant_tax', description='infant tax', example='9'),
        journeyList?: [ 
          {
            segmentList?: [ 
              {
                arrivalAirport?: string(name='arrival_airport', description='arrival airport code (capitalized)', example='MFM'),
                arrivalCity?: string(name='arrival_city', description='arrival city code (capitalized)', example='MFM'),
                arrivalTerminal?: string(name='arrival_terminal', description='arrival terminal', example='T1'),
                arrivalTime?: string(name='arrival_time', description='arrival time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 10:40:00'),
                availability?: string(name='availability', description='available seats (for reference only)', example='7'),
                cabin?: string(name='cabin', description='RBD', example='V'),
                cabinClass?: string(name='cabin_class', description='cabin class', example='Y'),
                codeShare?: boolean(name='code_share', description='code share or not', example='false'),
                departureAirport?: string(name='departure_airport', description='departure airport code (capitalized)', example='PVG'),
                departureCity?: string(name='departure_city', description='departure city code (capitalized)', example='SHA'),
                departureTerminal?: string(name='departure_terminal', description='departure terminal', example='T2'),
                departureTime?: string(name='departure_time', description='departure time in string format (yyyy-MM-dd HH:mm:ss)', example='2023-03-10 07:55:00'),
                equipType?: string(name='equip_type', description='equipment type', example='32Q'),
                flightDuration?: int32(name='flight_duration', description='flight time, unit: minute', example='165'),
                marketingAirline?: string(name='marketing_airline', description='marketing airline code (ex.: KA)', example='HO'),
                marketingFlightNo?: string(name='marketing_flight_no', description='marketing airline flight no. (ex.: KA5809)', example='HO1295'),
                marketingFlightNoInt?: int32(name='marketing_flight_no_int', description='marketing airline integer flight no. (ex.: 5809)', example='1259'),
                operatingAirline?: string(name='operating_airline', description='operating airline code (ex.: CX)', example='HO'),
                operatingFlightNo?: string(name='operating_flight_no', description='operating airline flight no. (ex.: CX601)', example='HO1295'),
                segmentId?: string(name='segment_id', description='segment ID format: flight no.+departure airport[IATA airport code]+arrival airport[IATA airport code]+departure time(MMdd)', example='HO1295-PVG-MFM-20230310'),
                stopCityList?: string(name='stop_city_list', description='stop city list
when stop_quantity > 1, use “,” for seperation', example='MFM,PVG'),
                stopQuantity?: int32(name='stop_quantity', description='number of stops', example='0'),
              }
            ](name='segment_list', description='segment Info'),
            transferCount?: int32(name='transfer_count', description='number of transfers', example='0'),
          }
        ](name='journey_list', description='segment list'),
        productTypeDescription?: string(name='product_type_description', description='product type description', example='""'),
        refundTicketCouponDescription?: string(name='refund_ticket_coupon_description', description='refund airline coupon description', example='""'),
        segmentBaggageCheckInInfoList?: [ 
          {
            luggageDirectInfoType?: int32(name='luggage_direct_info_type', description='through check-in baggage policy type
1. baggage through check-in between segments
2. baggage re-check-in needed between segments
3. baggage through check-in at stop city ( applies for stop flight )
4. baggage re-checkin needed at stop city ( applies for stop flight )', example='1'),
            segmentIdList?: [ string ](name='segment_id_list', description='segment id list. 
all the listed segment ids share the same baggage through check-in  policy'),
          }
        ](name='segment_baggage_check_in_info_list', description='through check-in baggage policy'),
        segmentBaggageMappingList?: [ 
          {
            passengerBaggageAllowanceMapping?: map[string]DataSolutionListSegmentBaggageMappingListPassengerBaggageAllowanceMappingValue(name='passenger_baggage_allowance_mapping', description='baggage rule mapping, key is passenger type, value is baggage allowance details'),
            segmentIdList?: [ string ](name='segment_id_list', description='segment id list. 
all the listed segment id share the same baggage rule'),
          }
        ](name='segment_baggage_mapping_list', description='baggage rule'),
        segmentRefundChangeRuleMappingList?: [ 
          {
            refundChangeRuleMap?: map[string]DataSolutionListSegmentRefundChangeRuleMappingListRefundChangeRuleMapValue(name='refund_change_rule_map', description='change and refund policy mapping, key is passenger type, value is change and refund policy details'),
            segmentIdList?: [ string ](name='segment_id_list', description='segment id list. 
all the listed segment ids share the same change and refund policy'),
          }
        ](name='segment_refund_change_rule_mapping_list', description='change and refund policy'),
        solutionId?: string(name='solution_id', description='solution ID', example='eJwz8DeySEo0NjQ01TU3TU7TNTFINNO1SE5O0jVKM0hKNjEwTElLNYwz0A32cNT1dfPVNTIwMjYwNjRQ8/A3NLI01Q0Ic0cRBwBVFxJJ'),
      }
    ](name='solution_list', description='solution list'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='""'),
  errorData?: any(name='error_data', description='error data', example='{}'),
  errorMsg?: string(name='error_msg', description='error message', example='""'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model SearchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchResponseBody(name='body'),
}

/**
 * @summary search
 *
 * @description Enter the information of departure, arrival, departure date, passenger number and cabin, return the lowest price for each flight.
 *
 * @param tmpReq SearchRequest
 * @param headers SearchHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchResponse
 */
async function searchWithOptions(tmpReq: SearchRequest, headers: SearchHeaders, runtime: Util.RuntimeOptions): SearchResponse {
  Util.validateModel(tmpReq);
  var request = new SearchShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.airLegs)) {
    request.airLegsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.airLegs, 'air_legs', 'json');
  }
  if (!Util.isUnset(tmpReq.searchControlOptions)) {
    request.searchControlOptionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.searchControlOptions, 'search_control_options', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.adults)) {
    body['adults'] = request.adults;
  }
  if (!Util.isUnset(request.airLegsShrink)) {
    body['air_legs'] = request.airLegsShrink;
  }
  if (!Util.isUnset(request.cabinClass)) {
    body['cabin_class'] = request.cabinClass;
  }
  if (!Util.isUnset(request.children)) {
    body['children'] = request.children;
  }
  if (!Util.isUnset(request.infants)) {
    body['infants'] = request.infants;
  }
  if (!Util.isUnset(request.searchControlOptionsShrink)) {
    body['search_control_options'] = request.searchControlOptionsShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Search',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-search`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary search
 *
 * @description Enter the information of departure, arrival, departure date, passenger number and cabin, return the lowest price for each flight.
 *
 * @param request SearchRequest
 * @return SearchResponse
 */
async function search(request: SearchRequest): SearchResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new SearchHeaders{};
  return searchWithOptions(request, headers, runtime);
}

model TicketingHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model TicketingRequest {
  orderNum?: long(name='order_num', description='order number

This parameter is required.', example='496***2617111'),
}

model TicketingResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    orderNum?: long(name='order_num', description='order number', example='496***2617111'),
    transactionNo?: string(name='transaction_no', description='transaction serial number', example='hkduendkd-2023-dj0'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model TicketingResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TicketingResponseBody(name='body'),
}

/**
 * @summary Transaction - Payment and Ticket Issuance
 *
 * @param request TicketingRequest
 * @param headers TicketingHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return TicketingResponse
 */
async function ticketingWithOptions(request: TicketingRequest, headers: TicketingHeaders, runtime: Util.RuntimeOptions): TicketingResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    body['order_num'] = request.orderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'Ticketing',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-ticketing`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Transaction - Payment and Ticket Issuance
 *
 * @param request TicketingRequest
 * @return TicketingResponse
 */
async function ticketing(request: TicketingRequest): TicketingResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new TicketingHeaders{};
  return ticketingWithOptions(request, headers, runtime);
}

model TicketingCheckHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', description='language Code(refer to ISO_639), defaults to the buyer\\\\"s account configuration', example='en_US'),
}

model TicketingCheckRequest {
  orderNum?: long(name='order_num', description='order number

This parameter is required.', example='496***2617111'),
}

model TicketingCheckResponseBody = {
  requestId?: string(name='RequestId', description='request ID', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: {
    orderNum?: long(name='order_num', description='order number', example='496***2617111'),
  }(name='data', description='data'),
  errorCode?: string(name='error_code', description='error code', example='null'),
  errorData?: any(name='error_data', description='error data', example='null'),
  errorMsg?: string(name='error_msg', description='error message', example='null'),
  status?: int32(name='status', description='http reqeust has been processed successfully，status code is 200', example='200'),
  success?: boolean(name='success', description='true represents success, false represents failure', example='true'),
}

model TicketingCheckResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TicketingCheckResponseBody(name='body'),
}

/**
 * @summary Transaction - Pre-payment verification
 *
 * @description Pre-check for Ticketing, this interface is optional to use.
 *
 * @param request TicketingCheckRequest
 * @param headers TicketingCheckHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return TicketingCheckResponse
 */
async function ticketingCheckWithOptions(request: TicketingCheckRequest, headers: TicketingCheckHeaders, runtime: Util.RuntimeOptions): TicketingCheckResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.orderNum)) {
    body['order_num'] = request.orderNum;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'TicketingCheck',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/trade/action-ticketing-check`,
    method = 'POST',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Transaction - Pre-payment verification
 *
 * @description Pre-check for Ticketing, this interface is optional to use.
 *
 * @param request TicketingCheckRequest
 * @return TicketingCheckResponse
 */
async function ticketingCheck(request: TicketingCheckRequest): TicketingCheckResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new TicketingCheckHeaders{};
  return ticketingCheckWithOptions(request, headers, runtime);
}

model TransitVisaHeaders {
  commonHeaders?: map[string]string,
  xAcsAirticketAccessToken?: string(name='x-acs-airticket-access-token', description='access_token

This parameter is required.', example='eyJhbGciOiJSUzI1NiIsImtpZCI6InN1ZXpfa2V5aWQifQ.eyJqdGkiOiJCQldMaWIzN0VxbC0xMjhhR2N5elJ3IiwiaWF0IjoxNjc3MDY2NTAxLCJleHAiOjE2NzcwNzM3MDEsIm5iZiI6MTY3NzA2NjQ0MX0.AF0DxsZK4Edyg0C6ObRQFUo36R1VYrb5IYmak25TmL1OfR5RkIUc3PpqFuQKNLKXf5fOtVQaKjaexzwodVeWZQDKEG_RPt_Ybb99EnEm6vPKs6e3pWFbKiBq71WleLHhVrdFb4YPowRKjc7bG0jyGUxiQ2iXy0RWDj9tIjfI-KEdzNp5oVnX7j4p3H12DwQrRPmd1nz3BciAQNINvDpzqusuIUw8JXyLFCz838Y0NhwB1_bYZyctxRLSzrGZuI5rrWtItgupqMsOlJ3RNy1QrIbQ2g6nPmzl-atOqcQ4Nw0HeDLR8dhM1OsIcFLbKXBUtwXofflhzAQrkDxhwYiXii'),
  xAcsAirticketLanguage?: string(name='x-acs-airticket-language', example='en_US'),
}

model TransitVisaRequest {
  flightSegmentParamList?: [ 
    {
      arrivalAirport?: string(name='arrival_airport', description='This parameter is required.', example='SIN'),
      arrivalTerminal?: string(name='arrival_terminal', example='T1'),
      arrivalTime?: long(name='arrival_time', description='This parameter is required.', example='1705285430445'),
      codeShare?: boolean(name='code_share', description='This parameter is required.', example='true'),
      departureAirport?: string(name='departure_airport', description='This parameter is required.', example='HGH'),
      departureTerminal?: string(name='departure_terminal', example='T1'),
      departureTime?: long(name='departure_time', description='This parameter is required.', example='1705285430445'),
      marketingAirline?: string(name='marketing_airline', description='This parameter is required.', example='CZ'),
      marketingFlightNo?: string(name='marketing_flight_no', description='This parameter is required.', example='CZ616'),
      operatingAirline?: string(name='operating_airline', example='CZ'),
      stopCityList?: string(name='stop_city_list', example='SEL,HKG'),
      ticketingAirline?: string(name='ticketing_airline', example='CZ'),
    }
  ](name='flight_segment_param_list'),
}

model TransitVisaShrinkRequest {
  flightSegmentParamListShrink?: string(name='flight_segment_param_list'),
}

model TransitVisaResponseBody = {
  requestId?: string(name='RequestId', example='51593418-8C73-5E47-8BA8-3F1D4A00CC0B'),
  data?: [ 
    {
      cityCode?: string(name='city_code', example='HGH'),
      visaType?: int32(name='visa_type', example='1'),
    }
  ](name='data'),
  errorCode?: string(name='error_code', example='null'),
  errorData?: any(name='error_data', example='null'),
  errorMsg?: string(name='error_msg', example='null'),
  status?: int32(name='status', example='200'),
  success?: boolean(name='success', example='true'),
}

model TransitVisaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TransitVisaResponseBody(name='body'),
}

/**
 * @summary 航程过境签
 *
 * @param tmpReq TransitVisaRequest
 * @param headers TransitVisaHeaders
 * @param runtime runtime options for this request RuntimeOptions
 * @return TransitVisaResponse
 */
async function transitVisaWithOptions(tmpReq: TransitVisaRequest, headers: TransitVisaHeaders, runtime: Util.RuntimeOptions): TransitVisaResponse {
  Util.validateModel(tmpReq);
  var request = new TransitVisaShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.flightSegmentParamList)) {
    request.flightSegmentParamListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.flightSegmentParamList, 'flight_segment_param_list', 'json');
  }
  var query : map[string]any = {};
  if (!Util.isUnset(request.flightSegmentParamListShrink)) {
    query['flight_segment_param_list'] = request.flightSegmentParamListShrink;
  }

  var realHeaders : map[string]string = {};
  if (!Util.isUnset(headers.commonHeaders)) {
    realHeaders = headers.commonHeaders;
  }
  if (!Util.isUnset(headers.xAcsAirticketAccessToken)) {
    realHeaders['x-acs-airticket-access-token'] = Util.toJSONString(headers.xAcsAirticketAccessToken);
  }
  if (!Util.isUnset(headers.xAcsAirticketLanguage)) {
    realHeaders['x-acs-airticket-language'] = Util.toJSONString(headers.xAcsAirticketLanguage);
  }
  var req = new OpenApi.OpenApiRequest{ 
    headers = realHeaders,
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TransitVisa',
    version = '2023-01-17',
    protocol = 'HTTPS',
    pathname = `/airticket/v1/flight-data/transit-visa`,
    method = 'GET',
    authType = 'AK',
    style = 'ROA',
    reqBodyType = 'json',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 航程过境签
 *
 * @param request TransitVisaRequest
 * @return TransitVisaResponse
 */
async function transitVisa(request: TransitVisaRequest): TransitVisaResponse {
  var runtime = new Util.RuntimeOptions{};
  var headers = new TransitVisaHeaders{};
  return transitVisaWithOptions(request, headers, runtime);
}

